We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cafbef commit 6b24f06Copy full SHA for 6b24f06
Sprint-3/alarmclock/alarmclock.js
@@ -14,14 +14,18 @@ function setAlarm() {
14
const input = document.getElementById("alarmSet");
15
const heading = document.getElementById("timeRemaining");
16
17
- const totalSeconds = Number(input.value);
18
- heading.innerText = `Time Remaining: ${formatTime(totalSeconds)}`;
+ let remainingSeconds = Number(input.value);
+
19
+ heading.innerText = `Time Remaining: ${formatTime(remainingSeconds)}`;
20
21
if (intervalId !== null) {
22
clearInterval(intervalId);
23
}
-
24
25
intervalId = setInterval(() => {
26
+ remainingSeconds -= 1;
27
28
29
}, 1000);
30
31
0 commit comments