JSON Syntax Rules
- Data is in name/esteem pairs
- Data is isolated by commas
- Curly props hold objects
- Square sections hold arrays
JSON Data - A Name and a Value
JSON information is composed as name/esteem pairs.
A name/esteem pair comprises of a field name (in twofold statements), pursued by a colon, trailed by a value:
JSON qualities can be:
- A number (whole number or gliding point)
- A string (in twofold quotes)
- A Boolean (genuine or false)
- An cluster (in square brackets)
- An object (in wavy braces)
JSON objects are composed inside wavy braces.
JSON clusters are composed inside square brackets.
In the precedent over, the item "employees" is a cluster containing three objects. Each item is a record of an individual (with a first name and a last name).
employees.firstName + " " + employees.lastName;
It can likewise be gotten to like this:
employees["firstName"] + " " + employees["lastName"];
Data can be altered like this:
It can likewise be altered like this:
- The record type for JSON documents is ".json"
- The MIME type for JSON content is "application/json"