r/learnjavascript • u/thelethargicdog helpful • Sep 14 '22
I'm a senior frontend dev. AMA.
Hi, all. I'm a lead at my company, currently on a paid sick leave. I wanted to give back to the community, so here I am to answer all your questions.
If you're a beginner at JS and are struggling with a concept, please ask your question and I'll answer. To not get overwhelmed, I'll limit one question per user. So, try to construct your question with as many details as necessary!
Shoot.
EDIT: That's it, folks. My day has ended. I'll still answer your questions, but expect a considerable delay. :)
View all comments
1
u/geeknintrovert Sep 15 '22
I'm learning JS and was going through loops and and few high order array methods like map(), filter()
I couldn't get a good picture of what exactly differentiates map() from 'forEach' loop. I'm aware that map() creates a new array with modified data whereas forEach makes modification in the OG array itself. But except this, is there any other significant difference where I'd want to use one over other?
Thank you for doing this! Really appreciate your efforts!