JsonArray::clear() removes all elements from the array pointed by the
JsonArray is null, this function does nothing.
Causes memory leaks ⚠️
JsonDocumentcontains a monotonic allocator, this function cannot release the memory associated with the removed value.
Consequently, you cannot call this function in a loop; otherwise, the
JsonDocument::clear() which doesn’t leak memory.
void clear() const;