factorial

Computes the factorial of the provided number.

//Compute 7!, which is equal to 5040
const computedFactorial = Math.factorial(7);

Return

The factorial of the provided number or undefined if the number is less than 0.

Parameters

n

The number whose factorial is to be computed.

See also