What is JSON ?
JSON stands for JavaScript Object Notation. It is easy for a user to read and write. It is a lightweight format, used for storing and transporting data. Data can be formatted using JSON. It looks like to object literal syntax. However, it is not just plain text data. Many times, it uses when data is sent from a server to a web page.

JSON Data
It is written as key and value pairs, just like JavaScript object properties. Key contains the name of the field, always in double-quotes. The value can be any data type as in the following table.
For Example:
{
"name": John,
"age": 31,
"gender": male
}
Keys
Key are “name”, “age”, and “gender’. It separated from the value by a colon. And each key and value pair is separated by a comma. However, remember there is no common after the last key and value pair.
Values
The value can be any of the following data types as shown in the following table.
string: Text must be written in double quotes.
number :Number.
boolean: true or false.
array: Array of value object. This can be contain child objects or array.
null: This is when the value in empty or missing.
JSON Syntax Rules
There are some rules as follow as.
- Data is in key/value pairs
- Separate data by commas(:)
- Objects are written inside curly braces{}
- Arrays must be written inside square brackets[].
JSON Objects
It written inside curly braces{}. AS JavaScript, objects can contain multiple name/value pairs:
For example:
{"firstName":"John", "age":"21"}
JSON Arrays
It written inside square brackets[]. Just like in JavaScript, an array can contain objects:
For example:
var text = '{"persons":[' +
'{ "name":"John" , "age":"24" },' +
'{ "name":"Annu" , "age":"30" },' +
'{ "name":"Ray" , "age":"32" }
]
}';