February 2014
Intermediate to advanced
120 pages
2h 30m
English
Learning how to create objects is the first step to understanding object-oriented programming. The second step is to understand inheritance. In traditional object-oriented languages, classes inherit properties from other classes.
In JavaScript, however, inheritance can occur between objects with no classlike structure defining the relationship. The mechanism for this inheritance is one with which you are already familiar: prototypes.
JavaScript’s built-in approach for inheritance is called prototype chaining, or prototypal inheritance. As you learned in Chapter 4, prototype properties are automatically available on object instances, which is a form of inheritance. The object instances ...
Read now
Unlock full access