Created
June 22, 2013 19:44
-
-
Save edubskiy/5842331 to your computer and use it in GitHub Desktop.
Add static properties for 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
/** | |
* Add static properties for object | |
* | |
* @param {object} properties - extendable properties | |
* @param {object} obj - extended object | |
*/ | |
extend: function(properties, obj) { | |
var extended = properties.extended; | |
for(var name in properties) { | |
obj[name] = properties[name]; | |
} | |
if (extended) extended(obj); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment