Skip to content

Instantly share code, notes, and snippets.

@marcelitocs
Created July 2, 2017 02:31
Show Gist options
  • Save marcelitocs/3c60b87ea2fa009976a303e33d6bebfe to your computer and use it in GitHub Desktop.
Save marcelitocs/3c60b87ea2fa009976a303e33d6bebfe to your computer and use it in GitHub Desktop.
extend function like $.extend
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];
}
@marcelitocs
Copy link
Author

For a more complete solution, use: https://github.com/unclechu/node-deep-extend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment