function factorial(num) { if (num < 1) { return 1; } else { return num * arguments.callee(num - 1); //等价于 return num * factorial(num - 1); } } alert(factorial(5));//5*4*3*2*1
function factorial(num) { if (num < 1) { return 1; } else { return num * arguments.callee(num - 1); //等价于 return num * factorial(num - 1); } } alert(factorial(5));//5*4*3*2*1