Solving Holy Digits Batman

This is the problem. I’ve not watched the source code properly. I want a general idea on how to approach this problem? I need no code answer.

for (d3 = 0; d3 < 10; d3++) {
  for (d2 = 0; d2 < 10; d2++) {
    for (d1 = 0; d1 < 10; d1++) {
      for (d0 = 0; d0 < 10; d0++) {
        if (((d3 != d2) != d1) != d0) {
          if (d3 === 3 * d1) {
            if ((d3 * 1000 + d2 * 100 + d1 * 10 + d0) % 2 !== 0) {
              if (d3 + d2 + d1 + d0 === 27) {
                console.log(d3);
                console.log(d2);
                console.log(d1);
                console.log(d0);
              }
            }
          }
        }
      }
    }
  }
}

Code is producing correct output, but also producing extra output, why’s that? Can you please fix this issue?