Ad
Code
Diff
  • factorial=n=>{for(x=i=1;i<n;)x*=++i;return x}
    • factorial=n=>(x=1,[...{*[Symbol.iterator](){for(i=2;i<=n;i++)yield x*=i}}],x)
    • factorial=n=>{for(x=i=1;i<n;)x*=++i;return x}