OBJECTS AND ITS INTERNAL REPRESENTATION IN JAVASCRIPT:

Ananth Astaputra
1 min readDec 4, 2020

Data types like string, number, boolean, null are primitive data types where they can store a single value whereas Arrays can store multiple values. Array in javascript is an Object where we can declare primitive data types also. Array is an indexing based Object.

let's see an example of Array

var arr = [1,”two”,3.5,true]

JSON OBJECT:

JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax. It is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or vice versa)

JSON object is a key-value pair in JavaScript where as array is index-based key should be of string type and value can be anything like int float string array an another JSON object also and can be function also. Let's see an example.

var json = {“name”:”sravi”, ”number”: 77280112368}

Here name, number are keys, and their values are represented. We can retrieve the value of JSON object by using json.name.

--

--

Ananth Astaputra
0 Followers

Enthusiastic in technological updates