All examples By author By category About

abernier

inherit.js

Classical inheritance for constructors.

INSTALL

Client-side

<script src="inherit.js"></script>

Server-side

npm install https://gist.github.com/abernier/decf360c677a54aa415c/download
var inherit = require('inherit');

Usage

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: