DEV Community

Discussion on: How reduce() function really works

Collapse
 
homam profile image
Homam

Reduce is inherently an abstraction over recursion. It is the most generic operation that we can do with all arrays. Every other operation on arrays can be re-defined using reduce alone. Shameless plug: I wrote a little post about this concept Reduce.