in reply to Re: Splice of ref to AoH not removing element
in thread Splice of ref to AoH not removing element

Adding to or removing from an array you're iterating over is a bad idea. If you create a loop over two elements (indices 0 and 1) and, on the first iteration, remove one element, what will happen on the second iteration?

However, if you would iterate in reverse order (1,0) then there would be no problem at all.

Liz

  • Comment on Re: Re: Splice of ref to AoH not removing element