Created
April 3, 2016 22:18
-
-
Save jamc92/cd1198b81ee01604cd8d72217e4229d5 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 factorialize(num) { | |
result = 1; | |
for (var i = 1; i <= num; i++) { | |
result *= i; | |
} | |
return result; | |
} | |
factorialize(10); |
Author
jamc92
commented
Apr 3, 2016
- factorialize(5) should return a number.
- factorialize(5) should return 120.
- factorialize(10) should return 3628800.
- factorialize(20) should return 2432902008176640000.
- factorialize(0) should return 1.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment