Today I Learned

A Hashrocket project

Ignore Array destructuring variables

If you don’t need an element in an array while destructuring it, simply omit a name:

const [, two, three] = [1, 2, 3];
console.log(two, three)
=> 2 3
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.