I have the following code but it is not giving perfect result for factorial can u find it out plz
1) When X=0 function should return 1; 2) Added return;
function fact(num) { var x=parseInt(num); //alert(x+1); if(x>0) x=x* fact(x-1); else x=1; return x; }
usage