Removed in ArduinoJson 6.20: use operator[] instead.


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

If the JsonArrayConst is null/unbound, this function does nothing.

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


JsonVariantConst getElement(size_t index) const;


index: the index of the value in the array.

Return value

JsonArrayConst::getElement() returns a JsonVariantConst that points to the value at the specified index.

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

See also