Last active
December 27, 2015 14:19
-
-
Save jonathanmarvens/7340201 to your computer and use it in GitHub Desktop.
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 classExtend(subClass, superClass) { | |
for (var property in superClass) { | |
if (superClass.hasOwnProperty(property)) { | |
subClass[property] = superClass[property]; | |
} | |
} | |
function constructor() { | |
this.constructor = subClass; | |
} | |
constructor.prototype = superClass.prototype; | |
subClass.prototype = new constructor(); | |
} |
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 classExtend(a,b){function d(){this.constructor=a}for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);d.prototype=b.prototype,a.prototype=new d} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment