JSON Syntax

Prev Tutorial Next Tutorial

JSON Syntax

All syntax of JSON is same like JavaScript syntax. JSON syntax is derived from JavaScript object notation syntax

  • In JSON data is write in name/value pairs.
  • Every data in JSON is separated by commas.
  • Curly braces are used for store objects.
  • Square brackets are used for store arrays.

JSON data - Name and a Value

In JSON data is write in name/value pairs, every name is written in double quotes " " and each data is separated by commas.



JSON Objects

JSON objects are written inside the curly braces { }. Same like JavaScript JSON objects can contain multiple name/values pairs:


{"firstName":"Komal", "lastName":"Pandit"}

JSON Arrays

JSON arrays are written inside square brackets [ ]. Same like JavaScript, a JSON array can contain multiple objects:


{"firstName":"Komal", "lastName":"Pandit"},
{"firstName":"Gaurav", "lastName":"Rawat"},
{"firstName":"Hitesh", "lastName":"Kumar"}

In above example employee is an array object which contain three objects.

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements