I have the following code but it is not giving perfect result for factorial can u find it out plz
Use loop its easy to implement
function fact(num) { if(num<0) return "Undefined"; var fact=1; for(var i=num;i>1;i--) fact*=i; return fact; }