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.
Array.prototype.reduce
Often in the case of clarity over speed, using for..of loops is the best. Sometimes, it's not always about clarity.
for..of
Good point. Thanks for that perspective!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.Good point. Thanks for that perspective!