Created
February 8, 2012 14:09
-
-
Save loktar00/1769790 to your computer and use it in GitHub Desktop.
Extend a js object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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