DEV Community

Discussion on: Writing modern JavaScript code

Collapse
 
moloko profile image
Matt Leathes

whilst array.map and array.forEach are unarguably more readable than for loops, aren't for loops still considerably faster in most browsers?

Collapse
 
galdin profile image
Galdin Raphael

I was thinking of the same. Found this relevant reddit discussion.

I think this is something browsers could optimize. Or probably they already do.
I wonder if there are any benchmarks around.