Last active
August 29, 2015 14:03
-
-
Save r4fx/cb4293366d50d35c941c to your computer and use it in GitHub Desktop.
JS $.extend
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
var defaults = { | |
radius: 25, | |
defaultradius: 0, | |
enableTilt: true, | |
tilt: 20, | |
random: true, | |
randomMax: 25, | |
colors: ['4AC7ED', 'FDC015', '9F78EC', 'F25C33'] | |
}; | |
console.log(defaults.colors.length); | |
console.log('Default Value colors[0] = ' + defaults.colors[0]); | |
var options = $.extend(defaults, { | |
enableTilt: false, | |
colors: ['ffffff', '000000'] | |
}); | |
console.log(options.colors.length); | |
console.log('New Value colors[0] = ' + options.colors[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment