curriculum/challenges/english/blocks/review-recursion/6723d1f0568292cd394d6fb6.md
Here is an example of a recursive function that calculates the factorial of a number:
function findFactorial(n) {
if (n === 0) {
return 1;
}
return n * findFactorial(n - 1);
}
In the above example, the findFactorial function is called recursively until n reaches 0. When n is 0, the base case is reached and the function returns 1. The function then returns the product of n and the result of the recursive call to findFactorial(n - 1).
Review the Recursion topics and concepts.