js array destructure default value code example
Example 1: destructure array javascript
var [first, second, ...rest] = ["Mercury", "Earth", ...planets, "Saturn"];
Example 2: object destructuring default value
let a, b;
[a=5, b=7] = [1];
console.log(a); // 1
console.log(b); // 7