0

Please I have a very simple question. What is the different between the array.forEach and array.map. I am confuse because they both run a function on each element of an array.

If they are the same why did they introduce the map function in ES6. If they are not where should map be used ahead of forEach.

Kabiru Wahab
  • 77
  • 1
  • 13

0 Answers0