Json - Introduction


Json - Introduction

  • JSON expands as Java Script Object Notation. 
  • It generates Java Script objects and hence the name JSON. 
  • JavaScript is used to parse the data interchangeformat object created by JSON.
  • The JSON object characterize data as a key/value pair in the form of collection or an ordered list.
  • Collection include object, record, struct, dictionary, hash table, keyed list or associated array.
  • Ordered list are arrays, vector list or sequence.

Sample Objects :

var company = {“name” : “WikiTechy”, “successrate”:100};


  • The above JSON object has a key-value pair.
  • The key should always be a string enclosed in double quotes.
  • The value can either be a string, number, Boolean or even an Object.
  • The key comes first followed by colon and then by the value. 
  • Key/value pairs are separated by comma.
Objects in JSON :
  • An object is denoted by curly brackets. 
  • The content present with this curly brackets are parts of the object. Also a value itself can be an object.

Sample JSON Object with Key-value pairs :

"WikiTechy" : {
  "site" : "www.wikitechy.com",
  "feedback" : [ "good", "nice" ]
}
"WikiTechy" : {
  "site" : "www.wikitechy.com"
}