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