Skip to content

Instantly share code, notes, and snippets.

@johnhutchins
Created October 16, 2019 00:11
Show Gist options
  • Save johnhutchins/6d1cf7eda43259013a8e5ac3987e8423 to your computer and use it in GitHub Desktop.
Save johnhutchins/6d1cf7eda43259013a8e5ac3987e8423 to your computer and use it in GitHub Desktop.
get factorial of a number
function factorial(num){
let total = 1;
for(let i=1;i<=num;i++){
total *= i;
}
return total;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment