Skip to content

London | May-2026-itp | Vitalii Kmit | Sprint 3 | Alarm clock - #1366

Open
Vitalii-code wants to merge 6 commits into
CodeYourFuture:mainfrom
Vitalii-code:alarm-clock
Open

London | May-2026-itp | Vitalii Kmit | Sprint 3 | Alarm clock #1366
Vitalii-code wants to merge 6 commits into
CodeYourFuture:mainfrom
Vitalii-code:alarm-clock

Conversation

@Vitalii-code

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Worked on the alarm clock

@Vitalii-code Vitalii-code added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 3, 2026
Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
@@ -1,4 +1,73 @@
function setAlarm() {}
const oneSecondInMilliseconds = 1000;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are declared but don't appear to be used anywhere. Are they still needed, or can they be removed to keep the code cleaner?

stopAlarm();

// set up time
timeLeft = document.getElementById("alarmSet").value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if I set the alarm for -10 seconds?

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated

// give a time in seconds
function formatTime(seconds) {
minutes = Math.floor(seconds / 60);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is minutes supposed to be a global variable?

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
minutes = Math.floor(seconds / 60);
seconds = seconds % 60;

const seconds_padded = String(seconds).padStart(2, "0");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the variable naming convention match style guide?

@hey-hammad hey-hammad added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 7, 2026
@Vitalii-code Vitalii-code added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 8, 2026
Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
// validate result
const result = parseInt(timeLeft);
console.log(result);
if (isNaN(result) || result < 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if I set the alarm to 0 or 2.5 seconds?

@hey-hammad hey-hammad added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 8, 2026
// validate result
const result = parseInt(timeLeft);
console.log(result);
if (isNaN(result) || result < 0 || !Number.isInteger(result)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integer validation doesn't seem to be working as expected. What value or type is being passed to Number.isInteger()?

result stores the validated input, but is it being used anywhere after the validation?

@hey-hammad hey-hammad added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants