Skip to content

Instantly share code, notes, and snippets.

@EliTheCoder
Created February 7, 2019 03:13
Show Gist options
  • Save EliTheCoder/3b152929d0b7022de55230857d6d6e65 to your computer and use it in GitHub Desktop.
Save EliTheCoder/3b152929d0b7022de55230857d6d6e65 to your computer and use it in GitHub Desktop.
function factorial(num) {
let answer = 1;
for (let i = 0; i < num; i++) {
answer *= num
num--;
}
return answer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment