Last active
August 29, 2015 14:11
-
-
Save westc/9f387520cdfde70648cf to your computer and use it in GitHub Desktop.
A simple way to write a function to make subclass (S) inherit from class (C) prior to Object.create() of ES5.
This file contains hidden or 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(C,S){var p='prototype';function O(){}O[p]=C[p];S[p]=new O} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment