Objects are collections of key-value pairs
An object stores data as properties, where each property has a key (string or Symbol) and a corresponding value (any data type, including other objects or functions).-
Objects can be created in multiple ways
The most common ways are:- Object literal:
const person = { name: "John", age: 30 }; - Constructor:
const person = new Object(); -
Object.create()method
- Object literal:
-
Properties can be accessed using two notations
- Dot notation:
person.name - Bracket notation:
person["name"](useful when the key is dynamic or contains special characters)
- Dot notation:
Objects are mutable and can hold methods
You can add, modify, or delete properties at any time.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Hi Mathu, 5? I only count four above but what about: