-
-
Save jfonte/0cdf39d48fb171bf1e450b6d82689267 to your computer and use it in GitHub Desktop.
Native JS Extend Functionality
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
/** | |
* Object Extending Functionality | |
*/ | |
var extend = function(out) { | |
out = out || {}; | |
for (var i = 1; i < arguments.length; i++) { | |
if (!arguments[i]) | |
continue; | |
for (var key in arguments[i]) { | |
if (arguments[i].hasOwnProperty(key)) | |
out[key] = arguments[i][key]; | |
} | |
} | |
return out; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment