JAVASCRIPT CLIMBSChapter 5 · JS Functions and Classes
The Reduce Method
The .reduce() method executes a reducer function on each element, resulting in a single output value.
Worked example
How it reads
- accumulator accumulates the callbacks' return values
- 0 is the initial value of the accumulator parameter

Cloud tip: The initial value is optional but highly recommended to avoid errors on empty arrays.


