Last active
August 29, 2015 14:04
-
-
Save twalker/10dffb9b00276e37898d to your computer and use it in GitHub Desktop.
tiny 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
// utility to assign defaults to options | |
function extend(target, source){ | |
target = target || {}; | |
for (var prop in source) { | |
if(!target.hasOwnProperty(prop)) target[prop] = source[prop]; | |
} | |
return target; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment