Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
A Javascript object is a data type in Javascript , it makes sense only in Javascript
javascript object notation (JSON) is a data interchange format, formatted a particular way
17down vote
JSON is a string representation of an object. It is an interoperable serialization format. It is not tied only to javascript. For example there are JSON serializers for .NET allowing you to serialize/deserialize .NET objects.
So it's just a format allowing you to convert from objects to string and back which is convenient if you want to transfer them over the wire.
It is very close to javascript object representation and if you simply eval() a JSON string you will get the corresponding object.
First you should know what JSON is:
The syntax of JSON was inspired by the JavaScript Object Literal notation, but there are differences between them.
For example, in JSON all keys must be quoted, while in object literals this is not necessary:
// JSON:{"foo":"bar"}// Object literal:var o ={ foo:"bar"};The quotes are mandatory on JSON because in JavaScript (more exactly in ECMAScript 3rd. Edition), the usage of reserved words as property names is disallowed