Skip to content

Instantly share code, notes, and snippets.

@sirLisko
Created May 10, 2012 13:13
Show Gist options
  • Save sirLisko/2652914 to your computer and use it in GitHub Desktop.
Save sirLisko/2652914 to your computer and use it in GitHub Desktop.
Extend - JavaScript function to extend Objects
var extend = function (obj, extObj) {
if (arguments.length > 2) {
for (var a = 1; a < arguments.length; a++) {
this.extend(obj, arguments[a]);
}
} else {
for (var i in extObj) {
obj[i] = extObj[i];
}
}
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment