Last active
August 14, 2016 17:21
-
-
Save Fishrock123/7453201 to your computer and use it in GitHub Desktop.
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 Other(args) { | |
Original.call(this, args); | |
}; | |
inherits(Other, Original); | |
// Yes, I know they are not actually "classes" | |
Other.prototype.classMethod = function() { | |
// called like so: | |
// var other = New Other() | |
// other.classMethod() | |
} |
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 inherits(clazz, sup) { | |
clazz.prototype = Object.create(sup.prototype); | |
clazz.prototype.constructor = clazz; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment