Skip to content

Instantly share code, notes, and snippets.

@swapnilmishra
Last active August 29, 2015 13:56
Show Gist options
  • Save swapnilmishra/8801979 to your computer and use it in GitHub Desktop.
Save swapnilmishra/8801979 to your computer and use it in GitHub Desktop.
A simple extend function in javascript
function extend(Child,Parent){
var F = function(){};
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment