Math question factors

Tell us what’s happening:
I’m curious why this code doesn’t work if I remove ‘factorialize’ from the return line.

Your code so far
function factorialize(num) {
if(num===0) {return 1;}
return num * factorialize(num-1);}

factorialize(5);
Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/factorialize-a-number

The function is recursive, it is call itself within itself until the num parameter is equal to 0.

1 Like