DEV Community

Discussion on: FCC Algorithm Challenges / Factorialize a Number

Collapse
 
jpantunes profile image
JP Antunes

The line const result = fac(num)*fac(num-1); , should be const result = num * fac(num-1); otherwise it will cause a stack overflow.