DEV Community


Discussion on: What the... iterators?

genta profile image
Fabio Russo Author • Edited

I think the big difference is in readability.
If we consider that many types of "loops" hide the "iterator" property as forEach, what makes a difference for us is, for example, that forEach can not be interrupted.
Most of the times “for” is faster... but that kind of difference, on speed, is really not a big deal.