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 b4bde21 commit ccf9c34Copy full SHA for ccf9c34
Sprint-3/alarmclock/alarmclock.js
@@ -10,9 +10,10 @@ function updateDisplay() {
10
}
11
12
function startCountdown() {
13
+ if (remainingSeconds < 0) remainingSeconds = 0;
14
timerId = setInterval(() => {
-
15
updateDisplay();
16
+
17
if (remainingSeconds <= 0) {
18
remainingSeconds = 0;
19
clearInterval(timerId);
@@ -25,14 +26,12 @@ function startCountdown() {
25
26
27
function setAlarm() {
28
const input = document.getElementById("alarmSet");
- if (input.value==="")return;
29
+ if (input.value === "") return;
30
const inputValue = Number(input.value);
31
32
33
timerId = null;
34
remainingSeconds = inputValue;
35
36
37
startCountdown();
38
input.value = "";
0 commit comments