Skip to content

Instantly share code, notes, and snippets.

@pingjiang
Created October 13, 2014 15:18
Show Gist options
  • Save pingjiang/717cbdd041f2ae65ea03 to your computer and use it in GitHub Desktop.
Save pingjiang/717cbdd041f2ae65ea03 to your computer and use it in GitHub Desktop.
nodejs-inherits
var inherits = function (ctor, superCtor) {
ctor.super_ = superCtor;
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment