JSON is a format used for storing and transmitting data.
It is commonly used to send data from a server to a web page.
Although JSON syntax is based on JavaScript object notation, it is a text-based format. Code for reading and generating JSON data can be written in any programming language.
This JSON syntax defines an employees
object, which is an array containing three employee records (objects).
{ “employees”:[ {“firstName”:“John”, “lastName”:“Doe”}, {“firstName”:“Anna”, “lastName”:“Smith”}, {“firstName”:“Peter”, “lastName”:“Jones”} ] } |
The JSON format is syntactically identical to the way JavaScript objects are created.
Due to this similarity, a JavaScript program can easily convert JSON data into native JavaScript objects.