1.JSON (JavaScript Object Notation) is a simple data format that is more lightweight than xml. JSON is a native JavaScript format, which means that no special API or toolkit is required to handle JSON data in JavaScript.
The rules of JSON are simple: an object is an unordered collection of "name:value" pairs. An object starts with "{" (left bracket) and ends with "}" (right bracket). Each "name" is followed by a ":" (colon); "name/value" pairs are separated by "," (comma).
The rules are as follows:
1) Mapping is represented by colon (":"). Name:value
2) Parallel data are separated by commas (","). Name 1: Value 1, Name 2: Value 2
3) The mapped collection (object) is represented by curly brackets ("{}"). {Name1:Value1,Name2:Value2}
4) The collection (array) of parallel data is represented by square brackets ("[]").
[
{name1:value,name2:value2},
{name1:value, name2:value2}
]
5) The types that element values can have: string, number, object, array, true, false, null
Five writing methods in 2.json:
1) Traditional way of storing data and calling data