What is an Object?
Curly brackets can be used to construct an object with an optional list of properties. A property is a "key: value" pair in which the key (or property name) must always be a string and the value (or property value) may be any data type, strings, integers, Booleans, or sophisticated data types like arrays, functions, and other objects. In order to separate them from other properties, properties that have functions as their values are moreover frequently referred to as methods.
Properties of Object
The dot (.) or square bracket ([ ]) notation can be used to access or obtain a property's value. Although the dot notation is simpler to read and write, it is not always appropriate. You must use bracket notation rather than dot notation if the property's name is invalid (that is, if it contains spaces or other special characters). Dot notation is substantially less flexible than square bracket notation. In addition, you may use variables to define property names rather than just text literals.
Object Attributes for Looping
The for...in loop may be used to traverse over the key-value pairs of an object. This loop has been expressly designed to be iteratively optimized for object characteristics.
Object Properties Setting
Similarly, by using the dot (.) or bracket ([ ]) notation, you may create new attributes or modify existing ones.