DEV Community

Discussion on: Explain REDUCE Like I'm Five

Collapse
 
devslewis profile image
Seth

The first explanation sounds a lot more like filter. You are more passing a function there that is checking if something is true or not. (Like is it interesting) and returning the one that passed.

Collapse
 
eaich profile image
Eddie • Edited

Ah that's true and good catch. I was thinking more along the lines of determining how long a movie is based on the current time and how long it would keep you up. Ignore explanation 1!! =)

Collapse
 
vonheikemen profile image
Heiker

But think about this: you could implement filter using reduce.