Skip to content

Instantly share code, notes, and snippets.

@jfonte
Forked from bhavyaw/objExtend.js
Created May 12, 2016 22:28
Show Gist options
  • Save jfonte/0cdf39d48fb171bf1e450b6d82689267 to your computer and use it in GitHub Desktop.
Save jfonte/0cdf39d48fb171bf1e450b6d82689267 to your computer and use it in GitHub Desktop.
Native JS Extend Functionality
/**
* Object Extending Functionality
*/
var extend = function(out) {
out = out || {};
for (var i = 1; i < arguments.length; i++) {
if (!arguments[i])
continue;
for (var key in arguments[i]) {
if (arguments[i].hasOwnProperty(key))
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