Description

JsonObject::size() returns the number of key-value pairs in the object pointed by the JsonObject.

Signature

size_t size() const;

Return value

JsonObject::size() return an unsigned integer that contains the number of key-value pairs in the object.

Example

JsonObject object = doc.to<JsonObject>();
object["hello"] = "world";
Serial.println(object.size()); // 1

See also