I have this code:
function printDelay(j) {
if (j != 0) {
setTimeout(() => {
console.log(j);
}, 1000);
j--;
print(j);
} else {
console.log("END!");
}
}
printDelay(5);
Why it doesn't print the numbers 5,4,3,2,1 with a delay of 1 second?