Skip to content

Instantly share code, notes, and snippets.

@westc
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save westc/9f387520cdfde70648cf to your computer and use it in GitHub Desktop.

Select an option

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.
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