Skip to content

Instantly share code, notes, and snippets.

@r37r0m0d3l
Created April 10, 2020 15:54
Show Gist options
  • Select an option

  • Save r37r0m0d3l/7f591f88dfa569ac6ac0860e12ca9bb4 to your computer and use it in GitHub Desktop.

Select an option

Save r37r0m0d3l/7f591f88dfa569ac6ac0860e12ca9bb4 to your computer and use it in GitHub Desktop.
const factorial = (n) => {
const next = n <= 1 ? () => n * 1 : () => n * factorial(n - 1);
return next();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment