liveBook · Manning

JSON object

As explained in Everyday Data Visualization

An unordered JSON collection of named members enclosed in curly braces, each consisting of a string key and a value.

A JSON object groups related data under named keys inside curly braces. Naming each value makes nested information easier to understand and reference than a pile of anonymous array positions. section 3.5.2

From positions to meaning

A seven-by-four array can represent days and times, but its repeated rows are hard to recognize. An object can label those rows with keys such as "Sunday" and "Monday", making the structure readable at a glance. section 3.5.2

Use objects when you need to:

  • Group numbers, strings, Booleans, arrays, or other related values under one name. section 3.5.2
  • Replace confusing positional repetition with labels that reveal what each value represents. section 3.5.2
  • Nest structured records, such as fruit names and taste scores, inside a larger object. section 3.5.2
 {
   "title": "Fruits",
   "version": 1.1,
   "data": [
       {
           "fruit_name": "Fuyu Persimmons",
           "taste_score": 100
       },
       {
           "fruit_name": "Mangos",
           "taste_score": 100
       },
       {
           "fruit_name": "Peaches + Nectarines",
           "taste_score": 100
       },
       {
           "fruit_name": "Bananas",
           "taste_score": 80
       },
       {
           "fruit_name": "Kiwis",
           "taste_score": 70
       },
       {
           "fruit_name": "Apples",
           "taste_score": 60
       },
       {
           "fruit_name": "Oranges",
           "taste_score": 50
       }
   ]
}

Inspect a complete nested object containing metadata and an array of fruit records. section 3.5.2

How Everyday Data Visualization covers it

How deep it goes
Explains objects through nested-array examples and readable labels, without detailing parsing, schemas, or implementation internals.
Examples
Uses weekday-and-time arrays, named fruit scores, and a nested fruit dataset with title, version, and records.
What it assumes
Assumes familiarity with basic data types and arrays while contrasting named objects with anonymous nested arrays.
What you can do after
Apply it to label nested data, replace opaque array positions, and group related values under a single name.
How it connects
Connects objects with JSON, arrays, nested data, and fundamental data types.

Also explained in

Compare how 7 books explain JSON object →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Everyday Data Visualization. The section links point to the parts of the book it draws on.