Skip to content

Instantly share code, notes, and snippets.

@mralexho
Created February 24, 2015 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mralexho/68904149289f8b27bad7 to your computer and use it in GitHub Desktop.
Save mralexho/68904149289f8b27bad7 to your computer and use it in GitHub Desktop.
function that makes the child object inherit from parent object
function inheritPrototype(childObject, parentObject){
var parentCopy = Object.create(parentObject.prototype);
parentCopy.constructor = childObject;
childObject.prototype = parentCopy;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment