Description

Returns the number of element in the array.

Signature

size_t size() const;

Return value

An unsigned integer containing the number of elements in the array.

Example

JsonArray array = doc.to<JsonArray>();
array.add("hello");
array.add("world");
Serial.println(array.size()); // 2

See also