liveBook · Manning

Array

As explained in Everyday Data Visualization

An array is an ordered collection of data elements represented in JSON with square brackets and comma-separated values.

An array is an ordered collection of data elements grouped under one name. In JSON, it uses square brackets, with values separated by commas. section 3.5.2

Think of a pill container: each bucket holds one value, and the whole container lets you handle related values together. A one-dimensional array has one layer of buckets; a two-dimensional array contains smaller arrays. section 3.5.2

Arrays become useful when data needs a shared structure:

  • Group several values so operations can apply to the collection as a whole. section 3.5.2
  • Keep values of the same data type within an array, such as all strings or all numbers. section 3.5.2 section 3.6
  • Nest arrays to represent multiple dimensions, while recognizing that deep nesting can become difficult to interpret. section 3.5.2
  • Place arrays inside objects when names are needed to clarify what each collection represents. section 3.5.2

A week of time slots

A one-dimensional array can list the days of the week. A two-dimensional version can store four time slots inside each day, such as Morning, Noon, Evening, and Night. section 3.5.2

[
   ["Morning", "Noon", "Evening", "Night"],
   ["Morning", "Noon", "Evening", "Night"],
   ["Morning", "Noon", "Evening", "Night"],
   ["Morning", "Noon", "Evening", "Night"],
   ["Morning", "Noon", "Evening", "Night"],
   ["Morning", "Noon", "Evening", "Night"],
   ["Morning", "Noon", "Evening", "Night"]
]

This nested listing shows one large array made from seven smaller arrays, making the second dimension visible at a glance. section 3.5.2

How Everyday Data Visualization covers it

How deep it goes
Explains JSON syntax, one and two dimensions, deeper nesting, data-type consistency, and the clarifying role of objects.
Examples
Uses pill containers, weekday lists, time-slot lists, nested arrays, and named arrays inside objects.
What it assumes
Assumes familiarity with basic values such as strings, numbers, Booleans, and dates before assembling them into arrays.
What you can do after
Build it from scratch as one-dimensional or nested JSON data, then choose objects when names improve clarity.
How it connects
Connects arrays with JSON, objects, data types, nested data, dimensions, and measures.

Also explained in

Compare how 40 books explain array →

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.