Skip to content

Instantly share code, notes, and snippets.

@lmignot
Created August 16, 2012 14:54
Show Gist options
  • Save lmignot/3370776 to your computer and use it in GitHub Desktop.
Save lmignot/3370776 to your computer and use it in GitHub Desktop.
Takes any number of objects and returns one merged object
//Thanks to: http://stackoverflow.com/users/101909/robkohr
//Posted here: http://stackoverflow.com/a/6635477
var objectMerge = function(){
var out = {};
if(!arguments.length)
return out;
for(var i=0; i<arguments.length; i++) {
for(var key in arguments[i]){
out[key] = arguments[i][key];
}
}
return out;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment