Skip to content

Instantly share code, notes, and snippets.

Function.prototype.inheritsFrom = function (base) {
this.prototype = Object.create(base.prototype);
this.prototype.constructor = this;
this.prototype._super = base.prototype;
return this;
};
var Base = function () {
if (!(this instanceof Base))
throw ('Constructor called without "new"');