Classical inheritance for constructors.
<script src="inherit.js"></script>npm install https://gist.github.com/abernier/decf360c677a54aa415c/downloadvar inherit = require('inherit');function A() {}
A.prototype.foo = function () {};
function B() {
B.uber.constructor.apply(this, arguments);
}
inherit(B, A);
B.prototype.foo = function () {
this.constructor.uber.foo.apply(this, arguments);
}NB:
B.uberreferences toA.prototype- classically, you can access the ctor from prototype's methods thanks to
constructorproperty.
http://bl.ocks.org/abernier/decf360c677a54aa415c