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