3 ms·
for each is syntactic sugar for a while loop with an iterator. It will always be slower than the classic for index loop over the same collection/array.
by Zardoz84 5mo ago
for each is syntactic sugar for a while loop with an iterator. It will always be slower than the classic for index loop over the same collection/array.