Easy
What is the difference between map and forEach, and which is more appropriate for creating a new array?
1const numbers = [1, 2, 3, 4];23const result = numbers.forEach((num) => num * 2);4console.log(result);
1const numbers = [1, 2, 3, 4];23const result = numbers.forEach((num) => num * 2);4console.log(result);