Home >Web Front-end >JS Tutorial >Day Functions Solution
Implement a factorial function with one parameter: an integer, n. It must return the value of n! (i.e., n factorial).
Locked stub code in the editor reads a single integer, n, from stdin and passes it to a factorial function.
The function must return the value of n!.
4
24
We return the value of 4! = 4x3x2x1 = 24.
Functions
LinkedIn | GitHub
The above is the detailed content of Day Functions Solution. For more information, please follow other related articles on the PHP Chinese website!