What is the right/best way to extend a javascript class so Class B inherits everything from the class A (class B extends A)?
This question is related to
javascript
extends
Douglas Crockford has some very good explanations of inheritance in JavaScript:
extend = function(destination, source) {
for (var property in source) {
destination[property] = source[property];
}
return destination;
};
You could also add filters into the for loop.
Source: Stackoverflow.com