Created
October 7, 2014 10:11
-
-
Save dutchcelt/a4d5cedf6679c8446008 to your computer and use it in GitHub Desktop.
Native extend.
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 extend(){ | |
for(var i=1; i<arguments.length; i++) { | |
for(var key in arguments[i]){ | |
if(arguments[i].hasOwnProperty(key)) { | |
arguments[0][key] = arguments[i][key]; | |
} | |
} | |
} | |
return arguments[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment