I have the following code but it is not giving perfect result for factorial can u find it out plz
function factorial (n) { if (n > 1) { return n * factorial(n-1); } return 1; } console.log("recursive way => ",factorial(5));