Q. What will this return?
Code:
[1, 2, 3].reduce((a, b) => a + b);
β
Correct Answer: (A)
6
Explanation: reduce sums the elements: 1 + 2 + 3 = 6.