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