for (let i = 10; i >= 0; i--) {
setTimeout(function() {
console.log(i);
}, 1000);
}
I want to show a simple countdown from 10
to 0
with a 1 second delay between each subtraction. I use the above example and it shows all the numbers in an instant. How could I fix this?