When to use map() vs. forEach()
I saw this post on Reddit about a JavaScript coding assessment and it got me thinking about map() and forEach(). They look similar, but they do different jobs. Here’s how I think about it, and why I usually go with map() when I’m transforming data. What’s map()? The map() method...