📅  最后修改于: 2022-03-11 15:02:22.585000             🧑  作者: Mango
function myFactorial(number) {
var fact = 1;
var i = number;
while (i >= 1) {
fact = fact * i;
i--;
}
return fact;
}
console.log(myFactorial(6));
//Output: 720;