Skip to content

Commit a04f01c

Browse files
formatting for the code for better for checking bugs
1 parent 0f8a136 commit a04f01c

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

Sprint-3/alarmclock/alarmclock.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,21 @@ function setAlarm() {
1616
const input = document.getElementById("alarmSet");
1717
let time = Number(input.value);
1818

19-
// Always reset first so old countdown stops
2019
resetAlarm();
2120

22-
// Validate input (reject decimals, negatives, NaN)
2321
if (isNaN(time) || time < 0 || !Number.isInteger(time)) {
2422
showError("Please enter a whole number of seconds.");
2523
return;
2624
}
2725

28-
// If time is 0, trigger alarm immediately
2926
if (time === 0) {
3027
updateHeading(0);
3128
playAlarm();
3229
return;
3330
}
3431

35-
// Show starting time
3632
updateHeading(time);
3733

38-
// Start countdown
3934
countdown = setInterval(() => {
4035
time--;
4136

0 commit comments

Comments
 (0)