This appears to outputs correctly. But does not pass the tests

Tell us what’s happening:
The following code outputs correctly but does not pass the tests. It appears to be a version of tail recursion. Will you provide a second opinion please? Thank you!

Your code so far

function factorialize(num, x=1) {
console.log('1. num', num);
console.log('1. x', x);
if(num===0) {
  num = x;
  console.log("1a. num", num);
  return num;
if(num >= 1) {
  x = x * num;
  console.log("1b. num", x);
  factorialize(num-1, x);


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36.

Challenge: Factorialize a Number

Link to the challenge: