📜  如何在javascript代码示例中使用递归查找数字的阶乘

📅  最后修改于: 2022-03-11 15:03:29.883000             🧑  作者: Mango

代码示例4
// Factorial of Number in Javascript using Recursive call in javascript
function  factorial(number){
  if(number === 0){
    return 1;
  }
  return number * factorial( number -1);
}
console.log(factorial(4));