Skip to content

Commit f9ad3be

Browse files
created a check to check if intervalId is null
1 parent 6a5d331 commit f9ad3be

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Sprint-3/alarmclock/alarmclock.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ function updateDisplay(seconds) {
5050
title.textContent = `Time Remaining: ${mins}:${secs}`;
5151
}
5252
function togglePause() {
53+
if (intervalId === null) {
54+
return;
55+
}
5356
if (!isPaused) {
5457
clearInterval(intervalId);
5558
isPaused = true;

0 commit comments

Comments
 (0)