Objects in JavaScript

Other programming languages have complex definition about object but in javascript have a simple definition about object. In JS object is a collection of name and value pairs. Example

const address = {

street: “main”,

number: 100,

apartment: {

floor: 5,

number: 300

}

}

Above example address is a object and (street, number, apartment ) is name and (main, 100 {floor: 5, number: 300} ) are values..

the apartment is it self object its name and value pairs are (floor, number), (5, 300)...

Comments

Popular posts from this blog

Call Stack in JavaScript with examples

Every JS developer should know these concepts.. Syntax Parsers, lexical Enviroments and Execution context

SASS vs SCSS in CSS