ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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

user-image
تم إضافة السؤال من قبل Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation
تاريخ النشر: 2017/02/23
Ehab  Shaker
من قبل 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
من قبل 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
من قبل 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.

مستخدم محذوف‎
من قبل مستخدم محذوف‎

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

المزيد من الأسئلة المماثلة