Software objects model real-world objects or abstract concepts such as banks, dogs, bicycles, etc. Real-world objects have states and behaviors. For example, bank accounts have states such as holder and balance as well as behaviors such as withdraw and deposit. Software objects use variables to implement states and methods/functions to implement behaviors.
An object is a concrete instance of a particular object type. Creating an object from an object type is called instantiation, and each object has a state (set of values associated to their attributes). It is a collection of properties that is associated with a name and a value. The properties can be accessed with a dot-notation (
. operator ) or with an indexer (
 square brackets). There are a lot of predefined objects in JavScript such as
window, all objects we have explored before. Objects can also be created by you, which is what we will be exploring more in this chapter.
The sample code above uses concepts we have already covered in the course previously. It access the object
Array and then calls the property
length respectively. The