Destructuring assignment allows you to assign the properties of an array or object to variables using syntax that looks similar to array or object literals. This syntax can be extremely terse, while still exhibiting more clarity than the traditional property access. This new syntax was introduced in ECMAScript 2015 (ES6).

// Array destructuring
let arr = [1, 2, 3];
let [a, b, c] = arr;
console.log(a); // 1
console.log(b); // 2
console.log(c); // 3

// Object destructuring
let obj = {
    x: 1,
    y: 2
}

let {x, y} = obj;
console.log(x); //1
console.log(y); //2

References