Skip to content

Instantly share code, notes, and snippets.

@KR1470R
Created July 12, 2020 07:32
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 KR1470R/d560095e004e236596c06f11df2d329b to your computer and use it in GitHub Desktop.
Save KR1470R/d560095e004e236596c06f11df2d329b to your computer and use it in GitHub Desktop.
Factorial Quick-Simple Way
let facrorial = number=>{
let f = 1
let i = 1
while (i<number){
i+=1
f = f*i
}
return f
}
let res = facrorial(5)
console.log(res,5**5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment