Lesson 20 of 35 · +140 xp

Array.reduce

Fold to one value.

Explained simply

Your task

Declare const sum = nums.reduce((a, b) => a + b, 0);

reduce.js
▶ Output (javascript)
Click 'Run code' to execute your code in a real sandbox.
← Back