Created
October 16, 2019 00:11
-
-
Save johnhutchins/6d1cf7eda43259013a8e5ac3987e8423 to your computer and use it in GitHub Desktop.
get factorial of a number
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
function factorial(num){ | |
let total = 1; | |
for(let i=1;i<=num;i++){ | |
total *= i; | |
} | |
return total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment