What is the difference in performance when using the foreach loop and map function?
What is the difference in performance in case of case 1 and case 2
var array = [1,2,3,4,5,7,788,9,234];
//case 1:
array.forEach((element) => {
// Some statements
})
//case 2:
array.map(() => {
// Some statements
})