DEV Community

Discussion on: Why Does JavaScript Do THIS? - Question #1

Collapse
 
methodbox profile image
Chris Shaffer

There are a couple of excellent answers. I just wanted to add that to achieve what you’re going for you may want to try .map instead of forEach.

Great question, though.