Skip to content

Instantly share code, notes, and snippets.

@detj
Created July 27, 2013 07:52
Show Gist options
  • Save detj/6094167 to your computer and use it in GitHub Desktop.
Save detj/6094167 to your computer and use it in GitHub Desktop.
Raw objects in JavaScript
function MyClass() {
//...
}
MyClass.prototype.method = function() {
//...
}
function MySubClass() {
//...
}
MySubClass.prototype = Object.create(MyClass.prototype);
MySubClass.prototype.constructor = MySubClass;
MySubClass.prototype.method = function() {
MySubClass.prototype.method.call(this);
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment