Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Challenge
- Factorial
- Sample Test Cases
- Input: 1
- Output: 1
- Input: 4
- Output: 24
- Input: 9
- Output: 362880
- */
- function FirstFactorial(num) {
- if (num === 0) {
- return 1;
- } else {
- return num * FirstFactorial(num - 1);
- }
- }
Add Comment
Please, Sign In to add comment