Reducing use of Array.reduce

I recently went on a short anti-reduce rant at work. Was in defence of forEach and local mutations, but I came to the conclusion that it's mostly just because I don't like reduce. Mostly when combined with fat arrow functions (which I also don't particularly like).

Writing reduce() makes you look smart. Reading reduce makes you feel stupid.

The recent HTTP 203: Is reduce() bad? covers many of my issues, the tldr:

reduce has some use-cases, but they are rarer than its usage suggests. Most of the time I favor filter or forEach.

← Posts