Created
June 24, 2014 15:07
-
-
Save ImanMh/97cfa62a7bde9237f8c9 to your computer and use it in GitHub Desktop.
Implemention of $.extendm _.extend method in pure JavaScript
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
//Originally by Ryan Lynch | |
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