@hornairs forEach needs to loop over a copy of the array, since it is used to modifiy the array in some places.
toArray ends up calling slice now.