Javascript extends class

Viewed 110046

What is the right/best way to extend a javascript class so Class B inherits everything from the class A (class B extends A)?

3 Answers

Douglas Crockford has some very good explanations of inheritance in JavaScript:

  1. prototypal inheritance: the 'natural' way to do things in JavaScript
  2. classical inheritance: closer to what you find in most OO languages, but kind of runs against the grain of JavaScript
Related