Difference between object literal notation and JSON

The Object literal notation is not as same as JavaScript Object Notation(JSON).


  • JSON property is defined as "property" : "value". The property cannot be short handed and it must be double quoted.
  • In JSON the values can be only strings,numbers,array,true,false,null or another JSON object.
  • A function can not be assigned to a value in JSON.
  • Objects like date can be a string after JSON.parse().
  • JSON.parse() will not accept computed property names and error will be thrown. 

No comments:

Post a Comment

Overview of AngularJS

AngularJS is an open source web application framework. It is now maintained by Google . The most of the code can be eliminated by using th...