Skip to content

Introduction To JSON

Hardikb19 edited this page Dec 13, 2019 · 1 revision

What is JSON?

JSON stands for JavaScript Object Notation. It is a lightweight format for storing and transporting data often used when data is sent from a server to a web page

Why do we use JSON?

When exchanging data between a browser and a server, the data can only be text. JSON is text, and we can convert any JavaScript object into JSON, and send JSON to the server. We can also convert any JSON received from the server into JavaScript objects. This way we can work with the data as JavaScript objects, with no complicated parsing and translations.

JSON Syntax Rules

  • Data is in name/value pairs
  • Data is separated by commas
  • Curly braces hold objects
  • Square brackets hold an array

JSON Values

In JSON, values must be one of the following data types:

  • a string
  • a number
  • an object (JSON object)
  • an array
  • a boolean
  • null

Go through this tutorial to learn about the basics of JSON

Go through this tutorial to learn about JSON Data Types