What is Object?
JavaScript is an object-based programming language and almost “everything” that makes up JavaScript is an object. The rest of the values (functions, arrays, regular expressions, etc.) are all objects except primitive types.
Object / reference type is a complex data structure that consists of several types of values (primitive type values or other objects) in a single unit.
| Primitive value | Object |
|---|---|
| immutable value | mutable value |
| pass by value | pass by reference |
Object is a set of properties that consist of keys and values.