Inheritance and Composition

In this chapter, we will cover the following recipes:

  • Extending a class
  • Assigning additional properties with constructor arguments
  • Overriding parent class instance methods
  • Overriding parent class static methods
  • Calling super methods
  • Using composition rather than inheritance to add behavior
  • Using mix-ins to add behavior
  • Passing a class as an argument
  • Checking class inheritance with Object.getPrototypeOf
  • Using throw to simulate abstract classes
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.137.152