Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between javascript object and javascript object notation ?

user-image
Question added by Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation
Date Posted: 2017/02/23
Ehab  Shaker
by Ehab Shaker , Dot Net Developer , Info Strategic

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 

Mostafa Mohamed
by Mostafa Mohamed , Solution Develoer , Link Development

JavaScript Object Is a Simple Variable Like var x =5 or var name = 'Mostafa' , It Has Properties So If The Object Was a Car For Example It Will Have Properties Like Color , Brand , Speed , etc .. Working With Objects Like This Is Called Object Oriented Programming(OOP)</hr> JavaScript Object Notation Or JSON Is a Way Or a Format For Writing Data , Most Likely Used To Transfer Data Between Different Apps Or In Different Places Inside and App  You Can Convert a JavaScript Object To JSON And Vice Versa Easily Using JavaScript Predefined Functions 

alaa liswe
by alaa liswe , ِAdministrative Assistant , Arab Open University

 

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.

Deleted user
by Deleted user

First you should know what JSON is:

  • It is language agnostic data-interchange format.

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

More Questions Like This