Q
What does Array.prototype.map() return?
-
A
undefined
-
B
A single accumulated value
-
C
The original array, modified in place
-
D
A new array with the callback's result for each element; the original array is unchanged
Correct Answer:
D. A new array with the callback's result for each element; the original array is unchanged
Explanation:
forEach returns undefined, and reduce returns a single accumulated value.