Skip to content

London | 26-ITP-May | Alex Jamshidi | Sprint 3 | Alarm Clock #1227

Open
Alex-Jamshidi wants to merge 6 commits into
CodeYourFuture:mainfrom
Alex-Jamshidi:alarmclock
Open

London | 26-ITP-May | Alex Jamshidi | Sprint 3 | Alarm Clock #1227
Alex-Jamshidi wants to merge 6 commits into
CodeYourFuture:mainfrom
Alex-Jamshidi:alarmclock

Conversation

@Alex-Jamshidi
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

created alarm clock code

@Alex-Jamshidi Alex-Jamshidi added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels May 13, 2026
Copy link
Copy Markdown
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

This generally looks good, but I left a few things to think about / work on.

Good job extracting away the duplication of showing a time into a reusable function.

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
let timer;

function setAlarm() {
timeSet = document.getElementById("alarmSet").value;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the scope of this variable? Is there a better scope for it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this would have been a global variable without declaring it
changed to 'const' to restrict scope to function

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
Comment on lines +6 to +8
if (time > 0) {
countdown(time);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you have this if block? What does it do? When will it run?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It doesn't, this was old code that I was using to stop the countdown, but later added into the setInterval function.

Redundant code - removed.

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
}, 1000);
}

function UpdateShownTime(timeRemaining) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The name of this function doesn't follow the same pattern of the other function names - can you make them consistent?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

removed capitalisation at start

@illicitonion illicitonion added 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. labels May 14, 2026
Comment thread Sprint-3/alarmclock/alarmclock.js Outdated

function setAlarm() {
const timeSet = document.getElementById("alarmSet").value;
const time = countdown(timeSet);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the point of this time variable now?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

have removed variable assignment as after deleting code snippet before, it is no longer used. countdown(timeSet) is run without result assigned to variable.

@Alex-Jamshidi Alex-Jamshidi 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 May 14, 2026
@illicitonion illicitonion added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels May 15, 2026
@illicitonion
Copy link
Copy Markdown
Member

Looks good, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Module-Data-Groups The name of the module. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants