Created
July 28, 2013 04:49
-
-
Save kyo-ago/6097453 to your computer and use it in GitHub Desktop.
簡単extend(jQuery.extendと動作が違うので注意)
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
(function () { | |
var result = {}; | |
[].slice.apply(arguments).forEach(function (val) { | |
Object.keys(val).forEach(function (key) { | |
result[key] = val[key]; | |
}) | |
}); | |
return result; | |
})({1: 2}, {3: 4}); | |
// Object {1: 2, 3: 4} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment