Tell us what’s happening:
My code is passing all tests except for calling the function with num but it still doesn’t work what am I doing wrong?
let num = 5;
function factorialCalculator (num) {
let result = 1;
for(let i=1; i <= num; i++){
result = result * i;
}
return result;
}
let factorial = factorialCalculator(num);
let resultMsg = `Factorial of ${num} is ${factorial}`;
console.log(resultMsg);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Challenge Information:
Build a Factorial Calculator - Build a Factorial Calculator