javascript unwrap object code example
Example 1: mdn destructuring
const x = [1, 2, 3, 4, 5];
const [y, z] = x;
console.log(y); // 1
console.log(z); // 2
Example 2: mdn destructuring
let a, b;
[a, b] = [1, 2];
console.log(a); // 1
console.log(b); // 2