Ad
Code
Diff
  • factorial = n => {
      let res = 1;
      for(let i = 2; i <= n; ++i){
        res *= i;
      }
      return res;
    }
    • factorial = n => eval([...Array(n)].map((_,i)=>++i).join`*`)??1
    • factorial = n => {
    • let res = 1;
    • for(let i = 2; i <= n; ++i){
    • res *= i;
    • }
    • return res;
    • }