O'Reilly logo

Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond by JD Isaacks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 28. Extending classes

After reading lesson 28, you will

  • Know how to extend classes to create more customized classes
  • Learn how to use libraries that provide a base class
  • Understand how inheritance works with classes
  • Know how to use super to invoke functions on the superclass

The best feature classes offer over traditional constructor function declarations is their ease of extension. Many consider the syntax for extending constructor functions clunky. This has led many library authors to create their own ways to extend base objects in their libraries. With built-in extendable classes, developers can learn one simple syntax that can be used everywhere. One crucial aspect to keep in mind when extending classes in JavaScript, however, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required