Tell us what’s happening:
my code is working on the console.log, but with the tutorial it is not. is it a problem with my algorithm? i wanted to use recursion becuase i am taking algorithm class in school right now, do i have to use a for loop ?
Your code so far
var i=1;
function factorialize(num) {
if (num>1){
factorialize(num-1)
}
i = i*num
return i;
}
factorialize(5);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number