Skip to content

Instantly share code, notes, and snippets.

@loktar00
Created February 8, 2012 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loktar00/1769790 to your computer and use it in GitHub Desktop.
Save loktar00/1769790 to your computer and use it in GitHub Desktop.
Extend a js object
// For extending the default object with properties
extend = function(obj, extObj){
for(var i in extObj){
if(obj.hasOwnProperty(i)){
obj[i] = extObj[i];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment