Description

Returns the number of key/value pairs in the object.

Signature

size_t size() const;

Return value

An unsigned integer containing 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