Here is modern 2025 recursive function to save to your name manager as FACTORIAL:
=LAMBDA(n, IF(n<3, n, n * FACTORIAL(n-1)))
And here is how to do it using a LET function without using the name manager:
=LET(f, LAMBDA(me,n, IF(n<3, n, n*me(me,n-1))), f(f, 10))