JavaScript · Exercise 1 of 5Next
Beginner
A countdown that stops itself
The page shows 3. Every 200 ms, count down: show and log 2, then 1.
After 1, show and log Go! and stop the timer, so nothing else happens afterwards.
Use setInterval for the repeating and clearInterval to stop it.
What Check tests
- The page ends on
Go! - The console shows 3, 2, 1, Go! in that order
- The countdown stops after Go!
- Uses
setIntervalandclearInterval
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.