Created
February 17, 2022 21:55
-
-
Save gpDA/1682a671560bd78c3d89304f62a910eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const factorialNumber = (num) => { | |
if (num === 1) return 1; | |
return num * factorialNumber(num - 1); | |
} | |
console.log(factorialNumber(5)); // 120 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment