📅  最后修改于: 2022-03-11 15:02:54.297000             🧑  作者: Mango
let myArray = [];
function calculateFactorial (myFacNumber)
{
let result = 1;
let c;
for(let x = 1; x<=myFacNumber; x++)
{
for(let j = x; j<=x;j++)
{
c= myArray[j] = x;
result *= c;
}
}
return result;
}
console.log(calculateFactorial(5));