The callback must return the accumulator for the next turn.
Acceptance criteria
- 1.#out should show 60.
The callback must return the accumulator for the next turn.
const numbers = [10, 20, 30]; const total = numbers.reduce((sum, n) => { const next = sum + n; }, 0); document.querySelector('#out').textContent = total === undefined ? "lost the total" : total;
Output ready when you are
Press Run to render your code, or Submit to validate your solution.