FactorialRecursion

Run Settings
LanguageJavaScript
Language Version
Run Command
const factorialRecursion = (n)=>{ if(n==1) return 1; return n*factorialRecursion(n-1); } const factorialIterative = (n)=>{ let fact = 1; for(let i=n;i>=1;i--) { fact = fact*i; } return fact; } console.log(factorialRecursion(5)); console.log(factorialIterative(5));
Editor Settings
Theme
Key bindings
Full width
Lines