destructuring create variable code example
Example 1: mdn destructuring
let a, b;
[a, b] = [1, 2];
console.log(a); // 1
console.log(b); // 2
Example 2: js destructuring explained
const { identifier } = expression;
let a, b;
[a, b] = [1, 2];
console.log(a); // 1
console.log(b); // 2
const { identifier } = expression;