I think the JS spec would have been better served with a different syntax for generator/iterator destructuring. Most code I've seen assumes that:
[a, b, ...rest] = array
is implemented like this: a = array[0]
b = array[1]
rest = array[2...]
When instead it is a giant performance footgun to the point where it should only be used outside of performance critical code.EDIT "next -> rest"