logoalt Hacker News

mcphageyesterday at 7:42 PM1 replyview on HN

> Reduce also forces you to conjure up a "zero" value of the relevant type, which isn't usually difficult but it does constitute some extra mental overhead.

It's always worthwhile to consider what the result will be when you pass in an empty list.


Replies

snackbrokenyesterday at 8:19 PM

Right. It's just one more thing you have to think about with Reduce that's not something you have to consider with Map/Filter.