Hi there!
Today I solved the challenge called “Factorialize a Number” using this code:
var result = 1;
function factorialize(num) {
if (num === 0){
return 1;
} else {
for (var i=1; i <= num; i++){
result *= i;
}
return result;
}
}
factorialize(5);
Which solves the challenge´s tests, returning the values specified, but for some reason, the tests don´t check out. Any thoughts?
Thanks!