Skip to content

Instantly share code, notes, and snippets.

@vasanthv
Last active September 19, 2018 10:02
Show Gist options
  • Select an option

  • Save vasanthv/f8ace98365b4c7d51ea6e7a6d6b8efde to your computer and use it in GitHub Desktop.

Select an option

Save vasanthv/f8ace98365b4c7d51ea6e7a6d6b8efde to your computer and use it in GitHub Desktop.
Get factorial of the given number
const factorial = (n) => (Array.from(Array(n), (_, i) => i + 1)).reduce((a, b) => a * b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment