$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #120

Complete the recursion

// returns n! (factorial) recursively
function factorial(n) {
  if (n <= 1) return ____;
  return n * factorial(n - 1);
}

Answer: 1 (also accepted: 1)

The factorial base case returns 1 so the product is correct.
Play Problem Solving ▸