Recursion in JavaScript with ES6, destructuring and rest/spread
Hugo Di Francesco
41410

Note that Array destructuring doesn’t just work with Arrays, it works with anything that’s iterable:

const [x,y] = new Set().add('a').add('b');
// x = 'a'; y = 'b'