array-reduce Flashcards

1
Q

What is Array.prototype.reduce useful for?

A

The reduce() method executes a user-supplied “reducer” callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the array is a single value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly