Created
October 27, 2015 05:07
-
-
Save laziel/b37a61605d531be7e06b to your computer and use it in GitHub Desktop.
extend
This file contains hidden or 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
| function extend() { | |
| var target = arguments[0] || {}; | |
| var length = arguments.length; | |
| var prop; | |
| for (var i = 1; i < length; i++) { | |
| if (typeof arguments[i] === 'object') { | |
| for (prop in arguments[i]) { | |
| target[prop] = arguments[i][prop]; | |
| } | |
| } | |
| } | |
| return target; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment