JavaScript Objects Introduction
JavaScript Objects
JavaScripts objects are similar to variables but they can contain multiple values, unlike variables which only contain a single value. Values are stored in objects in the form of name:value pairs. Moreover, we can say that JavaScript objects are containers for named values.
Object definition in JavaScript is:-
var objectName = [
propertyName:value,
propertyName:value,
];
Further Explanation:-
We can easily access any property by objectName.propertyName.
We can also write a method inside an object in the place of the property name and it can be accessed in a similar way.