how to destruture from arrya of object code example
Example 1: mdn destructuring
let a, b;
[a, b] = [1, 2];
console.log(a); // 1
console.log(b); // 2
Example 2: js object destructuring
const { [propName]: identifier } = expression;
let a, b;
[a, b] = [1, 2];
console.log(a); // 1
console.log(b); // 2
const { [propName]: identifier } = expression;