Created
January 18, 2012 22:08
-
-
Save tbranyen/1636125 to your computer and use it in GitHub Desktop.
Minimalist extend function
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
function extend(destination) { | |
var prop, source; | |
var index = 0; | |
var length = arguments.length; | |
while (++index < length) { | |
source = arguments[index]; | |
for (prop in source) { | |
destination[prop] = source[prop]; | |
} | |
} | |
return destination; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment