- while loops
- for loops
- for of
- for in
But which one should you use?
With the above in mind, here is some rule of thumb.
for ofoften for readability.
for i++when performance is critical or you need the index for other operations.
for inas they are 99% slower than regular
- Do NOT use
mapunless you want to store the returned array in a variable.