DEV Community

Discussion on: Stop mutating in map, reduce and forEach

Collapse
 
cwraytech profile image
Christopher Wray • Edited

After your explanation it makes a lot more sense using forEach.

And yes, when you’re reading the code, forEach gives me the right idea about what is actually happening when you’re using a callback function...

I think map makes sense when you are displaying that data (like a map) somewhere on the front end.