I didn't understand everything discussed above, but to me, the only asymmetry between head and tail destructuring is for infinite iterators:
`var [x] = neverEndingIterator` vs `var [...a, x] = neverEndingIterator // fails` in other cases plain arrays are quite symmetrical, they can be iterated from the start or the end. Finite iterators are iterable only from the start, but they would be 'expanded' in an array for tail destructuring. So I think it would make sense to remove the "Uncaught SyntaxError: Rest element must be last element in array" error, and maybe just let it freeze if the iterable is infinite, that's programmer's responsibility
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

