Why use map() when you could just use forEach()?
map() in the
generateHTML function, but map returns a new array. Why doesn't he just use
forEach() which simply iterates over each item in the array? Am I missing something?
Steven Parker207,003 Points
If you used "forEach", you'd need to first create a new empty array, and then inside the body of the forEach you would push the current item onto the new array.
Using "map" saves you a couple of steps since it's designed to return a new array.