Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 139 Bytes

File metadata and controls

13 lines (10 loc) · 139 Bytes

Factorial Solution

JavaScript

function factorial(n) {
  if (n <= 1) {
    return 1;
  }

  return n * factorial(n - 1);
}