/*计算阶乘*/function factorial(val){ if(val === 1 ) return val=1; return val* factorial(val-1);} factorial(10); function factorial(val){ if(val === 1 ) return val=1; return val+factorial(val-1);} factorial(10); 来源:https://www.cnblogs.com/yangyang520/p/11678118.html 标签 阶乘 递归