Created
August 3, 2016 05:44
-
-
Save ryanmorr/9fe745640541382b1906b94196fd2492 to your computer and use it in GitHub Desktop.
Inherit the prototype of a function
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 inherit(subclass, superclass) { | |
subclass.prototype = Object.create(superclass.prototype, { | |
constructor: { | |
value: subclass | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment