Represent related subfields in a child object.
Section: Object patterns
Nested object
json
json
{
"user": {
"id": 101,
"profile": {
"city": "Austin",
"timezone": "America/Chicago"
}
}
}Explanation
Nested objects group related data and reduce flat key sprawl.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Object patterns
Missing property vs null property
Omitting a field is different from setting it to null.
Mixed-type arrays are legal but risky
JSON allows mixed types, but they are often harder to consume.
Extract a field from each array item
Print one property from every object in an array.