Skip to content

Instantly share code, notes, and snippets.

@tiberiur
Created January 30, 2017 16:59
Show Gist options
  • Save tiberiur/a58cfc92f5407ce4e7cbfde3a0b73973 to your computer and use it in GitHub Desktop.
Save tiberiur/a58cfc92f5407ce4e7cbfde3a0b73973 to your computer and use it in GitHub Desktop.
[JS] Factorialize a Number
function factorialize(num) {
var answer = 1;
for (var i = 2; i <= num; i++) {
answer *= i;
}
return answer;
}
var answer = factorialize(5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment