Skip to content

Instantly share code, notes, and snippets.

@dlwjiang
Created August 5, 2018 22:37
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 dlwjiang/bdcc9740acd66eeb730eaed656aa9ca9 to your computer and use it in GitHub Desktop.
Save dlwjiang/bdcc9740acd66eeb730eaed656aa9ca9 to your computer and use it in GitHub Desktop.
factorial
const factorial = (n) => {
if (n < 2) return 1;
return n * factorial(n - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment