Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.
function foo ({
bar = 'no',
baz = 'works!'
} = {}) {(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /** | |
| * A linear interpolator for hexadecimal colors | |
| * @param {String} a | |
| * @param {String} b | |
| * @param {Number} amount | |
| * @example | |
| * // returns #7F7F7F | |
| * lerpColor('#000000', '#ffffff', 0.5) | |
| * @returns {String} | |
| */ |