Skip to content

Instantly share code, notes, and snippets.

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