Created
July 27, 2013 07:52
-
-
Save detj/6094167 to your computer and use it in GitHub Desktop.
Raw objects in JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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