GitLab interview question

Difference between .forEach and .map?

Interview Answer

Anonymous

12 May 2019

.forEach loops over each item on an array. .map loops through all items of an array and returns a new array.