Repository navigation
Conversation
| "jest": "^30.5.2", | ||
| "jest-environment-jsdom": "^30.5.2" |
There was a problem hiding this comment.
The Jest packages are pinned with ^30.5.2, a version range that does not match a published Jest release. Installing these dependencies will fail; could you verify the versions before adding them?
To "like" or "dislike" this comment, please follow this link
| .toString() | ||
| .padStart(2, "0")}:${(inputTime.value % 60).toString().padStart(2, "0")}`; | ||
|
|
||
| const toStop = setInterval(alarmCount, 1000); |
There was a problem hiding this comment.
What happens to the active countdown if Set Alarm is clicked again before it finishes?
To "like" or "dislike" this comment, please follow this link
| const toStop = setInterval(alarmCount, 1000); | ||
|
|
||
| function alarmCount() { | ||
| if (inputTime.value == 0) { |
There was a problem hiding this comment.
What does this condition do when Set Alarm is clicked with the number field left empty?
To "like" or "dislike" this comment, please follow this link
|
The CYF AI review has left comments. It will only review a PR one time. When you have addressed these comments, please request review again and a volunteer will take a look. |
hackertainment
left a comment
There was a problem hiding this comment.
The logic is very clear and easy to understand. The code also looks clean and good to me. Proper use of helper functions. Well done and please keep it up. Congratulation, you have completed this PR successfully. Thank you.
| const inputTime = document.querySelector("#alarmSet"); | ||
| const timeRemaining = document.querySelector("#timeRemaining"); |
There was a problem hiding this comment.
It might be worth to consider using .getElementById(" instead of .querySelector("# for clarity in the future.
There was a problem hiding this comment.
Thank you for your suggestion i will consider it next time!
| timeRemaining.textContent = `Time Remaining: ${Math.floor( | ||
| inputTime.value / 60 | ||
| ) | ||
| .toString() | ||
| .padStart(2, "0")}:${(inputTime.value % 60).toString().padStart(2, "0")}`; |
There was a problem hiding this comment.
This code is correct, but the indentation might make it a bit hard to read.
There was a problem hiding this comment.
You are right but I am afraid it is prettier :).
| if (toStop !== null) return; | ||
|
|
||
| toStop = setInterval(alarmCount, 1000); |
There was a problem hiding this comment.
A better logic could be:
if (toStop == null) {
toStop = setInterval(alarmCount, 1000);
}
Learners, PR Template
Self checklist
Task code
CYF-1098
Changelist
I have met all the criteria.
Questions