Skip to content

Instantly share code, notes, and snippets.

@vdclouis
Last active December 17, 2015 22:24
Show Gist options
  • Save vdclouis/38302a1ad152531ee287 to your computer and use it in GitHub Desktop.
Save vdclouis/38302a1ad152531ee287 to your computer and use it in GitHub Desktop.
Factorial
const fac = x =>
x < 0 ? 1 / 0 : x === 0 ? 1 : x * fac(x - 1);
fac(5); // 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment