It's All Writing.

Writing makes you happy.

How to implement summation and product with recursion or reduce at node

Environment

  • node

Code

Recursion

gist.github.com

Reduce

gist.github.com

Note

Typically, reduce is faster than recursion, and more simple.