Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Created June 27, 2011 21:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jiggliemon/1049896 to your computer and use it in GitHub Desktop.
Save jiggliemon/1049896 to your computer and use it in GitHub Desktop.
Extend properties
if(!Object.extend)
Object.extend = function(original){
var i = (original)?1:0
,args = arguments
,original = original || this
,length = args.length
,key,extended
for (; i < length; i++){
extended = args[i] || {};
for (key in extended){
if(extended.hasOwnProperty(key)) {
original[key] = extended[key];
}
}
}
return original;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment