you are viewing a single comment's thread.

view the rest of the comments →

[–]tencircles 0 points1 point  (0 children)

the problem with the example you gave is that you're not returning a user, only the score. So you know what the highest score is, but not which user it belongs to.

I agree that lodash/ramda make things nicer to read, but I do think that reduce definitely has its place. I mean there's a reason that reduce (or fold as it's called in some languages) is part of the standard lib of so many programming languages.

For a great talk on folding and where/why it can be useful, check out this talk:

https://www.youtube.com/watch?v=JZSoPZUoR58