Introduction
This was introduced in ES6. Destructuring JavaScript Iterables works on the same principle as Destructuring Arrays.
Syntax
const [x,...y] = 'abc'
console.log(x, y) // a ['b', 'c']This was introduced in ES6. Destructuring JavaScript Iterables works on the same principle as Destructuring Arrays.
const [x,...y] = 'abc'
console.log(x, y) // a ['b', 'c']