I am working on the Basic Algorithm Scripting: Factorialize a Number exercise. My code is:
function factorialize(num) {
if (num == 1) {
return 1;
}
else {
return num * factorialize(num-1);
}
}
factorialize(5);
however this does not work and gives the error
Maximum call stack size exceeded
I tried my code in another Jac=vaScript IDE and it worked fine and gave the correct answer so is there any reason why this wouldn’t work in FCC?