Skip to content

Instantly share code, notes, and snippets.

@afuggini
Created September 12, 2016 20:11
Show Gist options
  • Save afuggini/3b9430a9f3c6f181f16c4ac66cdad958 to your computer and use it in GitHub Desktop.
Save afuggini/3b9430a9f3c6f181f16c4ac66cdad958 to your computer and use it in GitHub Desktop.
Vanilla object extend function (UnderscoreJS)
var extend = function() {
var extended = {};
for(key in arguments) {
var argument = arguments[key];
for (prop in argument) {
if (Object.prototype.hasOwnProperty.call(argument, prop)) {
extended[prop] = argument[prop];
}
}
}
return extended;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment