Chapter 9: Objects
Objects are abstract data types used in programming. They can be used to represent real-world objects such as people, animals or places, as well as more abstract concepts such as bank account details, dates or file structures.
In some languages, such as Ruby, practically everything is an object. There are no primitive values, just objects. Even the number zero is an object. A large number of languages, such as Java, are class-based languages. These involve creating classes that act as a blueprint for creating all the objects in that class. For example, a Car class might specify that all Car objects will have an engine, four wheels and a choice of color.
JavaScript is not a class-based language (although you can define classes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access