DEV Community

Discussion on: Array.reduce() for newbies

Collapse
 
papaponmx profile image
Jaime Rios

Hi, thanks for the kind words.

The reason why I set the initial value to 0 is because I want to get a number from array.reduce.

Notice that the value for the accumulator could be anything like and array, an empty object, a boolean or a string.