Skip to content

JSON vocabulary

Array

An ordered sequence of values separated by commas and enclosed in brackets: [ ].

Example

[4, 8, 15, 16, 23, 42]

Boolean

True or false values.

JavaScript

A programming language. JSON is a subset of JavaScript.

JSON

A subset of the JavaScript programming language that is easy for humans and machines to read. JSON is a text format that holds structured data.

Nesting

Layers of arrays and objects.

Example

[
{"header": "File",
"items": [
    {"id": "Open", "label": "Open"},
    {"id": "New", "label": "New"},
    {"id": "Close", "label": "Close"}
    ]},
{"header": "View",
"items": [
    {"id": "ZoomIn", "label": "Zoom In"},
    {"id": "ZoomOut", "label": "Zoom Out"},
    {"id": "OriginalView", "label": "Original View"}
    ]}
]

Null

"Nothing." An empty value.

Object

Unordered key-value pairs separated by a colon and enclosed in curly braces/brackets: {}.

Example

{firstName: "Manish", favoriteFood: "pizza", favoriteColor: "blue"}

String

Text enclosed in double-quotation marks.


Sources