JSON (JavaScript Object Notation)

JSON (JavaScript Object Notation) is a standard file format that uses text to communicate data objects to array data types. This notation makes it easy for applications to parse and generate files. JSON grew out of the need to have a real-time server-to-web browser communication.

Datatypes

  • String
  • Number
  • Boolean
  • null
  • Object
  • Array

Eample

 1{
 2    //comments
 3    "string": "Anand vyas",  // String
 4    "number": { // number, float
 5        "age": 29,
 6        "cost": 299.99,
 7        "temperature": -10.5,
 8        "speed_of_light": 1.23e11
 9    },
10    "bool": true, // Boolean
11    "value": null, // Null value
12    "array": ["Anand","vyas"], // Array example
13    "people" : [ // Array with object
14        { "firstName": "John", "lastName": "Smith", "age": 35 },
15        { "firstName": "Jane", "lastName": "Smith", "age": 32 }
16    ],
17    "address" : { // Object
18        "line1" : "555 Main Street",
19        "city" : "Denver",
20        "stateOrProvince" : "CO",
21        "zipOrPostalCode" : "80202",
22        "country" : "USA"
23    }
24}