Hoodfc
1/9/2020 - 9:53 AM

Recursive Factorial

Calculates the factorial with recursion

// calculates the factorial of the given number with recursion [#11]
function factorial(num){
   if(num === 0) return 1;
   return num * factorial(--num);
}