Objects
• As we know from the chapter Data types, there are seven data types in
JavaScript. Six of them are called “primitive”, because their values
contain only a single thing (be it a string or a number or whatever). In
contrast, objects are used to store keyed collections of various data and
more complex entities. In JavaScript, objects penetrate almost every
aspect of the language. So we must understand them first before going
in-depth anywhere else.
2
Objects
• An object can be created with figure brackets {…} with an optional list of
properties. A property is a “key: value” pair, where key is a string (also called a
“property name”), and value can be anything.
• We can imagine an object as a cabinet with signed files. Every piece of data is
stored in its file by the key. It’s easy to find a file by its name or add/remove a
file.
3
Objects
4
Objects
5
Objects
6
Objects
7
Objects
8
Objects
9
Objects
10
Objects
11
Objects
12
Objects
13
Objects
14
Objects
15
Objects
16
Thank You
17