you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 month ago

The alternative most people probably use is iterative loops, like for loops and while loops and the like, with a mutable variable somewhere. I don't love it, personally.

I guess the other potential alternative is doing the iteration recursively, but I doubt that's what most people think of as an alternative to reduce.

  • source
  • parent