Skip to content

Instantly share code, notes, and snippets.

@clindsey
Created January 11, 2009 02:48
Show Gist options
  • Save clindsey/45622 to your computer and use it in GitHub Desktop.
Save clindsey/45622 to your computer and use it in GitHub Desktop.
Object.prototype.merge = function(other_object){
for(var i in this){
if(other_object[i]){
this[i]=other_object[i];
};
};
for(var i in other_object){
if(!this[i]){
this[i]=other_object[i];
};
};
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment