Closed giann closed 9 months ago
foreach should operate on a copy of the iterable so that the body of the loop can add/remove element from the iterable.
foreach
Ideally it should only do this if the loop body mutates the iterable.
foreach
should operate on a copy of the iterable so that the body of the loop can add/remove element from the iterable.Ideally it should only do this if the loop body mutates the iterable.