Object destructuring is similar, but it uses property names to match variables:
In this example, the object name: 'John', age: 30 is assigned to the variables name and age using destructuring. The property names on the right side of the assignment must match the variable names on the left side. javascript the definitive guide 8th edition pdf
const [x, y, z = 10] = [1, 2]; console.log(x); // 1 console.log(y); // 2 console.log(z); // 10 Object destructuring is similar, but it uses property