Previously when iterating over an array and modifying the same array via deletion of the current index, incorrect means was used to account for the change in index resulting in any further deletions being applied to the wrong elements.
This solution does not require duplication of the array or the use of external variables to track the number of deleted elements. We simply lower the `_forEachIndex` by 1 whenever an element is removed.