Skip to content

Instantly share code, notes, and snippets.

@Fishrock123
Last active August 14, 2016 17:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fishrock123/7453201 to your computer and use it in GitHub Desktop.
Save Fishrock123/7453201 to your computer and use it in GitHub Desktop.
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()
}
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