DEV Community

Discussion on: array.map(): A better way 🧐 ?

Collapse
 
brettthurs10 profile image
Brett Thurston • Edited

I just wrote a primer on the map method and in full disclosure, I've been using map as replacements for loops. MDN says, that shouldn't be used in that case and ONLY use it if you intended to use the array returned from the method.

dev.to/brettthurs10/grab-your-map-...

MDN bit:
developer.mozilla.org/en-US/docs/W...

dev-to-uploads.s3.amazonaws.com/i/...

Collapse
 
sereneinserenade profile image
Jeet Mandaliya

Thanks for sharing Brett, I loved that example of user cards.

I've mentioned in the Task description mentioned in the post that we need to create a new array, so that should be no problem for using map(). Even though I will mention your comment in my post so readers can have a better look at info you provided here.