DEV Community

Discussion on: You don't need Array.reduce()

Collapse
 
jtenner profile image
jtenner

I use Array.prototype.reduce a lot. The reason why is because v8 and firefox does a very good job of optimizing reduce calls when it gets optimized.

Often in the case of clarity over speed, using for..of loops is the best. Sometimes, it's not always about clarity.

Collapse
 
trusktr profile image
Joe Pea

Good point. Thanks for that perspective!