Description

Gets or replaces a value in the array.

Signatures

JsonVariant operator[](size_t index) const;

Arguments

index: the zero-based position of the value in the array.

Return value

A reference to the JsonVariant in the array.

Example

JsonArray array = doc.to<JsonArray>();
array.add(42);
int value = array[0];
array[0] = 666;

See also