Skip to content

Instantly share code, notes, and snippets.

@andrepadez
Created March 16, 2013 18:15
Show Gist options
  • Save andrepadez/5177617 to your computer and use it in GitHub Desktop.
Save andrepadez/5177617 to your computer and use it in GitHub Desktop.
Object.prototype.ext = function(obj){
for(var prop in obj){
if(!Object.prototype[prop]){
this[prop] = obj[prop]
}
}
}
var x = {a: 1, b: 2, c: 3}
x.ext({a: 4, d: 5})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment