DEV Community

Why so much ".forEach() VS .map()" posts in javascript?

Ahmadou Waly NDIAYE on January 22, 2020

I saw many posts comparing .forEach() and .map(), but I have never seen a situation where we are faced with a problem of choice between these 2 API...
Collapse
 
gmartigny profile image
Guillaume Martigny

People are not comfortable with functional programming I think. Both functions browse the array so new devs use the two indistinctively. You appear to grasp the difference between the two so good for you. 😀