$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · easy · #81

What is the output?

console.log([1, 2, 3].reduce((a, b) => a + b));
  1. 6
  2. 0
  3. 123
  4. NaN
With no seed, reduce starts from the first element and adds the rest.
Play Problem Solving ▸