Command Palette

Search for a command to run...

Hectal
Phase 26: Interview Deep Dives
React · Exercise 1 of 6Next
Intermediate

Fix the auto-counter stuck at 1

Interview warm-up (10 minutes). This auto-counter should go up by one every 100 ms after Start (id="start") and pause on Stop (id="stop"). Pressing Start again continues from where it stopped.

Right now it sticks at Count: 1 and Stop doesn't stop anything. Fix both bugs. Keep the paragraph id="count" showing Count: N.

What Check tests

  1. It starts at Count: 0
  2. After Start it keeps counting (3 or more after 450 ms)
  3. Stop really stops it
  4. Start again continues from the same number

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.