Roberto Aley

menu

javascript

A Case For Reduce Part 1

6/6/2021

JavaScript provides many useful functions to loop through an array and execute an operation on each element of the array like forEach, filter, map, reduce, find, some, every and many more.

Filter and map are generally over while forEach and reduce are not only less used but reduce also receives a lot of hate for "making" the code harder to read and not being useful at all.

During my career as a developer I have learned about clever and useful ways of effectively applying reduce and making it an important tool to have in your belt as a programmer. Regardless of the programming language that you use, it is important to learn the tools that your language offers and make them work to solve the problems that you are facing as a programmer.

So my plan with this post is to ma...