Description

Adds a new nested array to the end of the array.

Signature

JsonArray& createNestedArray();

Return value

A reference to the new JsonArray. You can check JsonArray::success() to verify that the allocation succeeded.

Example

StaticJsonBuffer<200> jsonBuffer;
JsonArray& array = jsonBuffer.createArray();
array.add("hello");
JsonArray& nested = array.createNestedArray();
nested.add("world");
array.printTo(Serial);

will write

["hello",["world"]]

See also

Global warming stripes by Professor Ed Hawkins (University of Reading)