Skip to content

Instantly share code, notes, and snippets.

@Jurtly
Created June 8, 2016 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jurtly/772f0dc0be05af46cb759c032ddf09fa to your computer and use it in GitHub Desktop.
Save Jurtly/772f0dc0be05af46cb759c032ddf09fa to your computer and use it in GitHub Desktop.
Just help from the bonfires FACTORIALIZE A NUMBER
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