4.13 THE CONCEPT OF CLASSES
JavaScript does not have a formal notation for Class. This makes it quite different from the other popular object-oriented languages like Java. However, realizing that JavaScript is a loosely typed language, this is hardly surprising! Notwithstanding this, it is still an object-oriented language. In languages like C++ or Java or C#, Classes are defined once and all objects are instantiations of the Class. In JavaScript, Classes can be simulated through the concept of objects and functions. An Object is a data structure that can (also) mimic a container containing attributes and methods. Methods can be implemented through functions. These properties can be dynamically added to the object at run time as well, which makes ...
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