Closed juliangruber closed 11 years ago
hmm, what happens if you try to delete items inside forEach on a normal array?
Normally, I iterate backwards when I delete items in an array, then removing an item doesn't change the indexes of the items that I havn't looked at yet.
bad things :D I just have to get my mind into this-is-just-in-memory-and-synchronous space.
What this gist does is it puts 10 rows into a
Set
and then tries to delete all of them.Only half get deleted.
What fixes it is slicing the
_array
before iterating over it.Or should I do this myself by calling
Task.asArray().slice().forEach()
?