I see below countdown function not work, but I do not know the execution order of this countdown. What is the execution order of this countdown function?
function countdown() {
let i;
console.log("Countdown:");
for(i=5; i>=0; i--) {
setTimeout(function() {
console.log(i===0 ? "Finish!" : i);
}, (5-i)*1000)
;
}
}
countdown();