What’s wrong with my code? the test 7 ,8 and, 11 failed to run
Your code so far
let num = 1;
function factorialCalculator(number) {
let result;
for(let x = 1; x <= number; x++) {
return number ** (x);
}
}
const factorial = factorialCalculator(num);
const resultMsg = `Factorial of ${num} is ${factorial}`
console.log(resultMsg)
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Challenge Information:
Build a Factorial Calculator - Build a Factorial Calculator