JSON Syntax RulesThe JSON syntax is a subset of the JavaScript object representation syntax.
- Data in key-value pairs
- Data is separated by commas
- Curly braces Save Object
- Square brackets Save Array
JSON name/value pairsThe writing format for JSON data is: name/value pairs. Names in name/value pairs are written in front (in double quotes), value pairs are written behind (also in double quotes), separated by colons:
This is easy to understand and is equivalent to this JAVASCRIPT statement:
JSON ValueThe JSON value can be:
- Number (integer or floating point)
- String (in double quotes)
- Logical value (TRUE or FALSE)
- Array (in square brackets)
- Object (in curly braces)
- Null
JSON object is JS object-oriented target, prototype JS Object-oriented Foundation
The writing format for/*json data is: name/value pairs. The difference between the JSON in C + + and the format written by the JSON object in JS:
The names of keys in C + + are enclosed in double quotes, and JS does not require
Names in name/value pairs are written in front (in double quotes), value pairs are written behind (also in double quotes), separated by colons:
1
"FirstName": "John"
This is easy to understand and is equivalent to this JAVASCRIPT statement:
1
Firstname= "John"
*/
JSON files and JSON objects