Javascript Object

Last Updated: November 19, 2020

Define Javascript Object

We will see how to define Javascript Object called Product with some properties like name and the id

var product = {
    id: 0001,
    name: 'Coca Cola 175ml',
    
};

How to access the property

You can use the dot syntax to access the property

console.log(product.name)