C2. Inheritance

There are several inheritance-related topics in JavaScript:

  1. Constructor functions - constructors as factories for instances, similar to classes in other languages.

  2. Constructor prototype property - prototypical inheritance.

  3. constructor property - reference to constructor function.

  4. instanceof operator - checking prototype chain.

  5. Enforce usage of new - how to guarantee that constructor function called with new.

Last updated