Skip to content

Commit e44f40f

Browse files
authored
Update alarmclock.js
1 parent 3e6b4ff commit e44f40f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎Sprint-3/alarmclock/alarmclock.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
let inputSeconds;
1+
function setAlarm() {
2+
let inputSeconds;
23
let timer;
34

45
function setAlarm() {
@@ -20,7 +21,7 @@ function setAlarm() {
2021

2122
if (inputSeconds <= 0) {
2223
clearInterval(timer);
23-
window.playAlarm();
24+
playAlarm();
2425
}
2526
}, 1000);
2627
}
@@ -31,9 +32,11 @@ function updateDisplay() {
3132

3233
document.getElementById("timeRemaining").textContent =
3334
`Time Remaining: ${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
35+
}
3436
}
3537

3638
// DO NOT EDIT BELOW HERE
39+
3740
var audio = new Audio("alarmsound.mp3");
3841

3942
function setup() {
@@ -50,8 +53,6 @@ function playAlarm() {
5053
audio.play();
5154
}
5255

53-
window.playAlarm = playAlarm;
54-
5556
function pauseAlarm() {
5657
audio.pause();
5758
}

0 commit comments

Comments
 (0)