The object and array are composite data types. Let’s learn about the object. An object is considered as properties of objects and functions associated with the object. The following is the dot notation −
As you can see above, properties and methods are denoted using dot notation. The notation begins with object name (dept) and ends with property name (dept_id).
Object properties can be any of the three primitive data types, or any of the abstract data types, such as another object. Object properties are usually variables that are used internally in the object's methods but can also be globally visible variables that are used throughout the page.
The syntax for adding a property to an object is −
objectName.objectProperty = propertyValue;