Mark As Completed Discussion

Try this exercise. Click the correct answer from the options.

The reduce function applies the callback function on every element passing in the return value of preceding calculations. Check out the code and guess the output.

JAVASCRIPT
1const arr = [1,2,3,4,5,6,7,8,9,10];
2 
3const reduced_arr = arr.reduce((prev,next)=> prev+next);
4 
5console.log(reduced_arr);

Click the option that best answers the question.

  • [55]
  • [9 10]
  • 55