A stopwatch counts up every second. Each time you click Reset the counter resets but the speed doubles — after three resets it ticks four times per second.
Click Reset once — the counter ticks normally but jumps by 2 every second. Click again — jumps by 3. The interval stacks with each reset.
Every time the effect runs, it creates a new interval. Without a cleanup function returning clearInterval, the old intervals are never cancelled.
Every time the effect runs, it creates a new interval. Without a cleanup function returning clearInterval, the old intervals are never cancelled.