DEV Community

.forEach(), .map(), .filter() .... What's the difference?

Johnson Ogwuru on May 11, 2018

.forEach: .forEach(), is used to execute the same code on every element in an array but does not change the array and it returns undefined. Exampl...
Collapse
 
patricktingen profile image
Patrick Tingen

Guys? ;)

Collapse
 
ogwurujohnson profile image
Johnson Ogwuru

Urhmmmmm.. Lol

Collapse
 
patricktingen profile image
Patrick Tingen

It was a bit tongue in cheek, and I don't want to be too PC, but it's these small things that could make a (small) difference.

That's all, folks 😇

Thread Thread
 
ngattusohw profile image
Nick Gattuso

You're being too PC lol. Great article ogwuru.

Thread Thread
 
ogwurujohnson profile image
Johnson Ogwuru

Thanks nick

Collapse
 
9z3 profile image
Roman Gusev

Are you assuming that only guys can be interested in higher-order functions?

Thread Thread
 
ogwurujohnson profile image
Johnson Ogwuru

Nope, not at all

Thread Thread
 
isaacleimgruber profile image
IsaacLeimgruber

Lmao what is this triggered question pls

Collapse
 
realabbas profile image
Ali Abbas

Absolute Knowledge. Great Article Dev

Collapse
 
ogwurujohnson profile image
Johnson Ogwuru

Thanks, glad you enjoyed it.

Collapse
 
andrewdtanner profile image
Andrew Tanner 🇪🇺

Simple. Love it! Now I know what Map and Filter do.

Collapse
 
ogwurujohnson profile image
Johnson Ogwuru

I'm happy you loved it. Thanks

Collapse
 
isaacleimgruber profile image
IsaacLeimgruber

Fold_left/Fold_right some days?

Collapse
 
zain667 profile image
zain

simple and clean, thanks a lot

Collapse
 
frontendengineer profile image
Let's Code

i agreed

Collapse
 
frontendengineer profile image
Let's Code

These are definitely essential knowledge engineers have to know. Would add a supplemental video on top of this post.