Tell us what’s happening:
Step 6 comes as incorrect and i can’t figure it out.
Your code so far
let num = 5;
const factorialCalculator = (number) => {
let result = 1;
for (let i = 1; i <= number; i++) {
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/151.0.0.0 Safari/537.36
Challenge Information:
Build a Factorial Calculator - Build a Factorial Calculator