Skip to content

Instantly share code, notes, and snippets.

@bhavyaw
Last active August 11, 2018 20:53
Show Gist options
  • Select an option

  • Save bhavyaw/25b115603630ebf2271d to your computer and use it in GitHub Desktop.

Select an option

Save bhavyaw/25b115603630ebf2271d 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;
};
@jfonte

jfonte commented May 12, 2016

Copy link
Copy Markdown

this works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment