Created
August 16, 2012 14:54
-
-
Save lmignot/3370776 to your computer and use it in GitHub Desktop.
Takes any number of objects and returns one merged object
This file contains 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
//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