
Development
Javascript ES6: Destructuring with default values
This is a short, but very useful code snippet for destructuring variables with default values (if the value is undefined). Very useful snippet for avoiding errors caused by undefined variables. In the following example, the options object is being destructured. const { valFirst = 1, valSecond = "hello", valThird = false } = options;