In brief
reduce() passes an accumulated result from one array element to the next.
Useful to know
reduce() passes an accumulated result from one array element to the next. Its callback receives the accumulator and current element; the returned value becomes the next accumulator. [1]
For example, [4, 7, 2].reduce((sum, value) => sum + value, 0) returns 13. Starting at zero, the successive sums are 4, 11 and 13. With the same initial value, an empty array returns 0.
Without an initial value, the first element becomes the starting accumulator and processing begins with the next. An empty array then throws TypeError. [1]
Not every loop needs to become reduce(). A simple sum is readable, while complex conditional accumulation may be clearer as an ordinary loop. Choose the form that helps the next reader understand the operation.
Sources
For further detail and to check the information: