factorial recursion javascript code example
Example: factorial recursion javascript
function factorial(n){
if(n==0){
return 1;
}else{
var result = 1;
result = factorial(n-1) * n;
}
return result;
}
function factorial(n){
if(n==0){
return 1;
}else{
var result = 1;
result = factorial(n-1) * n;
}
return result;
}