Skip to content

Instantly share code, notes, and snippets.

@kyo-ago
Created July 28, 2013 04:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyo-ago/6097453 to your computer and use it in GitHub Desktop.
Save kyo-ago/6097453 to your computer and use it in GitHub Desktop.
簡単extend(jQuery.extendと動作が違うので注意)
(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