Created
June 8, 2016 07:23
-
-
Save Jurtly/772f0dc0be05af46cb759c032ddf09fa to your computer and use it in GitHub Desktop.
Just help from the bonfires FACTORIALIZE A NUMBER
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) { | |
// factorial is the product of all positive integers less than or equal to n | |
var i = 1; | |
var f = 1; | |
var a; | |
var maybe = []; | |
while ( i <= num) { | |
f = f * i; | |
i++; | |
} | |
return f; | |
} | |
factorialize(5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment