2 ms·
Array destructuring doesn't use [0] access. It iterates the right-hand side. On the one hand, that means that trying to array-destructure NaN does in fact thr
by bzbarsky 11y ago
Array destructuring doesn't use [0] access. It iterates the right-hand side. On the one hand, that means that trying to array-destructure NaN does in fact throw. On the other hand, it means you can array-destructure a generator, which is a very desirable thing to be able to do.