how to find factorial of a number using Recursion in javascript
// how to find factorial of a number using Recursion in javascript
function factorial(n) {
if(n<=1){
return 1;
}else{
return n * factorial(n - 1);
}
}
console.log(factorial(5));
// output : 120