Hello, I was wondering if this code is any different from the answer provided by FCC. Is there any difference or benefits writing it the way FCC did, or is mine fine as well?
This is the FCC answer, my answer is after this:
function factorialize(num) {
if (num === 0) { return 1; }
return num * factorialize(num-1);
}
Your code so far
function factorialize(num) {
if (num!==0) {
return num*factorialize(num-1);
}
else {
return 1;
}
}
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.77 Safari/537.36
.
Link to the challenge: