Hacker News new | ask | show | jobs
by Zardoz84 50 days 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.