Ahh, man, anyone here can show me how to perform factorials in JavaScript? I tried a long long time, still failed.
unfortunately, this would work perfectly if it was getting squares for n, but please help me.Code:function FACTORIAL(n){ var i,e,f; for(i=1;i<=n;i++){ e=i; f=i; e=e*f; document.write(e + ", "); }





Reply With Quote