What is JSON?

JSON stands for JavaScript Object Notation, It is a format for storing and transporting data, It’s often used when data is sent from a server to a web page. The JSON syntax is derived from JavaScript object notation syntax, but the JSON format is text only. the code that generates JSON data can be written in any programming language, not only JavaScript.

Javascript Code.

JSON Example:

To help you understand the topic more, I got a JSON syntax example from W3schools. The example defines an employees object: an array of 3 employee records (objects):

JSON Example.

JSON Example.

As you can see, the JSON syntax is identical to the syntax of JavaScript objects. that’s why a JavaScript program can easily convert JSON data into native JavaScript objects.

JSON Objects

JSON objects are written inside curly braces, just like in regular JavaScript.

JSON Object.

JSON Object.

JSON Arrays

JSON arrays are written inside square brackets. Just like in regular JavaScript JSON arrays can contain objects. Take a look at the example below:

JSON Array.

JSON Array.

#web-development #javascript #json #programming #developer

Understanding JSON in JavaScript - Learn JSON With Practical Examples
3.50 GEEK