Description

If the JsonVariantConst points to an object, JsonVariantConst::size() returns the number of key-value pairs in the object (same as JsonObjectConst::size())

If the JsonVariantConst points to an array, JsonVariantConst::size() returns the number of elements in the array (same as JsonArrayConst::size())

In all other cases, JsonVariantConst::size() returns 0

Internally, this function walks a linked-list to count the elements, so its time complexity is O(n).

Signature

size_t size() const;

See also