Skip to content

Instantly share code, notes, and snippets.

@oldj
Last active April 10, 2017 06:46
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 oldj/2fa79ab543bb401654e08af20cb1d3d8 to your computer and use it in GitHub Desktop.
Save oldj/2fa79ab543bb401654e08af20cb1d3d8 to your computer and use it in GitHub Desktop.
计算阶乘
new Array(10)
.fill(0).map((_, i) => i)
.reduce((p, c, i) => p * (i + 1), 1); // 3628800
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment