JsonArray::getElement() gets the value at the specified index in the array pointed by the JsonArray.

If the JsonArray is null, this function does nothing.

Instead of this function, you can use operator[] which offers a more intuitive syntax.


JsonVariant getElement(size_t index) const;


index: the index of the value in the array.

Return value

JsonArray::getElement() returns a JsonVariant that points to the value at the specified index.

JsonArray::getElement() returns null when the index is out of range; in which case JsonVariant::isNull(), returns true.

See also