DEV Community

Discussion on: What s wrong with Array.reduce ?

 
alainvanhout profile image
Alain Van Hout

Though, for completeness, all of those are just loops in disguise (which isn't an argument for or against it).

Thread Thread
 
jbristow profile image
Jon Bristow • Edited

Only if you consider loops and tail recursion to be the same thing, which is debatable.

Also, it's only the same when applied to lists.

Other monadic structures may not act as loops at all, when called with reduce aka fold