Skip to main content
0:00est. 3 min

Chapter 33- JSON and Object Literals

Notes

JSON - Javascript Object Notation, It's inspired by object literals
Example 1
//Object Literal
var objectLiteral = {
firstName : "Mary",
isAProgrammer : true
}

In previous years data was sent over the internet in various formats and the format landed upon a while is xml. Problem was download time, Because it was using lots of bandwidth if you are dealing with lot of data so Object literal format was used to pass data in JSON string format.
The only difference is properties are wrapped in quotes in JSON



//JSON - Subset of object literal syntax
{
"firstName": "Mary",
"isAProgrammer": true
}