Created
February 7, 2019 03:13
-
-
Save EliTheCoder/3b152929d0b7022de55230857d6d6e65 to your computer and use it in GitHub Desktop.
This file contains 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
function factorial(num) { | |
let answer = 1; | |
for (let i = 0; i < num; i++) { | |
answer *= num | |
num--; | |
} | |
return answer; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment