Skip to content

Instantly share code, notes, and snippets.

@timothy
Created February 4, 2017 20:01
Show Gist options
  • Save timothy/3b9897011e6d7d33f48aebb5c17c3f99 to your computer and use it in GitHub Desktop.
Save timothy/3b9897011e6d7d33f48aebb5c17c3f99 to your computer and use it in GitHub Desktop.
/**
* Author https://github.com/timothy
* @return {number}
*/
function Factorial(num) {
return num <=1 ? 1 : num * Factorial(num - 1);
}
console.log(Factorial(8));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment