DEV Community

loading...

JS map(), filter() & reduce() explained!

lucagrandicelli profile image Luca Grandicelli ・1 min read

Just found this on the Internet. Worth a share /w you.

Discussion (5)

pic
Editor guide
Collapse
curtisfenner profile image
Curtis Fenner

I like map and filter, but reduce doesn't really explain what's going on. eat isn't a function that takes two pieces of food (and if it is, after the first bite in this example one of those "food" is 💩)

Collapse
bigschatz profile image
bigschatz

Hi Luca,

This is a fantastic and fun way to explain these methods! You gave a very simple example that looks at the big picture.

Great job 👍

Collapse
kleene1 profile image
kleene1

Lol nice one haha 😄

Collapse
dolfoestevam profile image
Rodolfo Estevam

Sharing just a print of a post without explaining the whole process which happens underneath the code?

What do you think about the fundamentals behind it?

Collapse
lucagrandicelli profile image
Luca Grandicelli Author

This is just a funny meme and is not meant to be a fully explanation of the fundamentals behind those functions. Dev.to has plenty of them :)