JSON (JavaScript Object Notation)

JSON (JavaScript Object Notation) is a standard text-based data interchange format that enables applications to exchange data over a computer network.

Datatypes

  • String
  • Number
  • Boolean
  • null
  • Object
  • Array
{
    //comments
    "string": "Anand vyas",  // String
    "number": { // number, float
        "age": 29,
        "cost": 299.99,
        "temperature": -10.5,
        "speed_of_light": 1.23e11
    },
    "bool": true, // Boolean
    "value": null, // Null value
    "array": ["Anand","vyas"], // Array example
    "people" : [ // Array with object
        { "firstName": "John", "lastName": "Smith", "age": 35 },
        { "firstName": "Jane", "lastName": "Smith", "age": 32 }
    ],
    "address" : { // Object
        "line1" : "555 Main Street",
        "city" : "Denver",
        "stateOrProvince" : "CO",
        "zipOrPostalCode" : "80202",
        "country" : "USA"
    }
}