I have the following code but it is not giving perfect result for factorial can u find it out plz
What about:
function fact(n) { n = Math.round(n); if (n < 2) { return 1; } else { return n * fact(n - 1); } }
?