Explain Objects in Javascript?

Objects in JavaScript, just as in many other programming languages, can be compared to objects in real life. The concept of objects in JavaScript can be understood with real-life, tangible objects.

A JavaScript object has properties associated with it. A property of an object can be explained as a variable that is attached to the object. Object properties are basically the same as ordinary JavaScript variables, except for the attachment to objects. The properties of an object define the characteristics of the object. You access the properties of an object with a simple dot-notation:

objectName.propertyName

There are 3 ways to create objects.

JavaScript Object by object literal

The syntax of creating an object using object literal is given below:

object={property1:value1,property2:value2.....propertyN:valueN}

By creating an instance of Object

The syntax of creating an object directly is given below:

var objectname=new Object();

By creating an instance of Object

The syntax of creating an object directly is given below:

var objectname=new Object();