DEV Community

Discussion on: Please don't "overchain" array methods

Collapse
 
jay97 profile image
Jamal Al

While using map filter and reduce is great for readability. Using a for loop is the fastest of all. So if your looking to optimize as much as possible i would go with a for loop.

Collapse
 
zorqie profile image
I, Pavlov

In Chrome 71 level2Sum is still 88% slower than a C-style for loop.

jsperf.com/chained-maps-vs-for-loop

In Edge 42 the level3Sum is just as slow as the original chained maps.