-
-
Notifications
You must be signed in to change notification settings - Fork 221
Birmingham | 25-ITP-Sep | Joy Opachavalit | Sprint 3 | Alarm clock app #875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Sprint-3/alarmclock/alarmclock.js
Outdated
| let intervalId = null; | ||
|
|
||
| function format(seconds) { | ||
| const m = String(Math.floor(seconds / 60)).padStart(2, "0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enjoy15 We can make this variable name more descriptive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable name changed to minute
Sprint-3/alarmclock/alarmclock.js
Outdated
|
|
||
| function format(seconds) { | ||
| const m = String(Math.floor(seconds / 60)).padStart(2, "0"); | ||
| const s = String(seconds % 60).padStart(2, "0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enjoy15 We can make this variable name more descriptive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable name changed to second
| heading.textContent = `Time Remaining: ${format(remaining)}`; | ||
| } | ||
|
|
||
| function tick() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! @enjoy15
|
|
||
| function setAlarm() { | ||
| const value = parseInt(input.value, 10); | ||
| if (!Number.isFinite(value) || value <= 0) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice validation! @enjoy15
However, it would help readability to add a short comment explaining what this guard clause does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment added
Learners, PR Template
Self checklist
Changelist
-Completed alram clock app