2 ms·
This is the whole point of an iteration protocol—it’s not supposed to be that generators are like arrays, but rather that generators and arrays share the proper
by chrismorgan 12y ago
This is the whole point of an iteration protocol—it’s not supposed to be that generators are like arrays, but rather that generators and arrays share the property of being iterable. I’m imagining that the fuss over this now is because JavaScript simply hasn’t been like this in the past, where languages like Python have been. I do know that I’ve missed it when working in JavaScript as every other language I use tolerably frequently has sound iteration semantics. I’m certainly looking forward to the time when for..of can be considered a baseline feature.