Agreed on most counts. You don't mention that for loops also allow you to break out of the loop early; which depending on context can provide performance benefits.
There is very little good usage for reduce.
On the contrary, there are some incredibly useful applications for reduce and it can often be used when a normal for loop seems like the only option.
Agreed on most counts. You don't mention that
for
loops also allow you to break out of the loop early; which depending on context can provide performance benefits.On the contrary, there are some incredibly useful applications for
reduce
and it can often be used when a normalfor
loop seems like the only option.You can't use BREAK or CONTINUE in a foreach/filter/map etc. Normal for loops are there for a reason.