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']