Write your function 'countdown' here // For example with the argument '3', it should log: // countdown(3) /* 3 2 1 Blast off! */
let countdown = 3; let loop = setInterval(function() { if(countdown > 0){ countdown -= 1; console.log(countdown)://Log the countdown } else { clearInterval(loop);//Stop looping console.log('Blast off!'); } },1000);//Repeat every second
need help with countdown function
Write your function 'countdown' here
// For example with the argument '3', it should log:
// countdown(3)
/*
3
2
1
Blast off!
*/