Javascript extends class

xpepermint picture xpepermint · Feb 13, 2010 · Viewed 110k times · Source

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

Answer

cletus picture cletus · Feb 13, 2010

Take a look at Simple JavaScript Inheritance and Inheritance Patterns in JavaScript.

The simplest method is probably functional inheritance but there are pros and cons.