JSON GUIDE · 3 MIN READ
Work with JSON arrays
Inspect ordered values, mixed records, empty lists, and array transformations safely.
Order is part of the data
An array is an ordered list. The first item has index zero in common programming tools, and swapping two items changes the array. Elements can have different types, so a list containing a string, null, and an object is still valid JSON.
An empty array is different from null and from an absent property. They might respectively mean no items, an explicit unknown value, and a field that was not supplied. Do not replace one with another without understanding the consuming application.
[{"id":1,"name":"Ada"},{"id":2,"name":"Lin","active":true}]Use tables for records and trees for mixed values
A table makes arrays of similarly shaped objects easier to compare. The example has an active field in only one row; a useful table keeps that distinction visible instead of assuming every row has the same keys. A tree works better for deeply nested or mixed values.
Before sorting or deduplicating, decide what identifies a record. Two objects may share an id but have different values. Splitting preserves sequence only if you combine chunks in the same order. Preview a transformation and keep the original before applying it.

