Skip to content

Glasgow | Jan-26 | Elisabeth Matulian | Sprint 3 | Alarm clock app#1020

Open
Elisabeth-Matulian wants to merge 4 commits intoCodeYourFuture:mainfrom
Elisabeth-Matulian:Alarm-clock-app
Open

Glasgow | Jan-26 | Elisabeth Matulian | Sprint 3 | Alarm clock app#1020
Elisabeth-Matulian wants to merge 4 commits intoCodeYourFuture:mainfrom
Elisabeth-Matulian:Alarm-clock-app

Conversation

@Elisabeth-Matulian
Copy link
Copy Markdown

@Elisabeth-Matulian Elisabeth-Matulian commented Mar 16, 2026

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

Updated the <title> tag in index.html

Implemented the setAlarm() function

Added a countdown timer with the title updated every second

Added clearInterval to pauseAlarm() to stop the timer

Questions

N/Q

@Elisabeth-Matulian Elisabeth-Matulian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 16, 2026
@hkavalikas hkavalikas self-requested a review March 22, 2026 11:24
@hkavalikas hkavalikas 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 Mar 22, 2026
Comment on lines 59 to 63
function pauseAlarm() {
audio.pause();
//I know it's said to not edit this code, I wonder if it's ok to add this line below in order to pause the time before the time runs out.
clearInterval(intervalId);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Excellent catch, and the approach is correct, as a bonus task, though, how can we make this change and add the clearInterval call, without editing anything below the // DO NOT EDIT BELOW HERE line?

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.

Could you give me a hint?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sure thing, what if I told you that you can have multiple event listeners for the same element?

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.

I still couldn't figure out how to implement it 😵‍💫

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You have actually done it, but the code is commented out on lines 43-45. You can indeed register multiple event listeners to the same element as you did; they won't override each other. For what is worth, adding them in the pause alarm did make sense too, but I hope it was an interesting extra step. Let's comment it back it and I will approve :)

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.

Oh, so that’s how it works)))

I didn’t think it would work, I just left it as a comment so you could see the way I think and point me in the right direction. That’s surely something I’ll remember))

@hkavalikas
Copy link
Copy Markdown

Finally, let's try to add a few more details to the Changelist. The purpose of the changelist is to mention individual updates/additions/changes made for this PR, not so much to add a headline (like the title) of the changes.

@hkavalikas hkavalikas 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 Mar 22, 2026
@Elisabeth-Matulian Elisabeth-Matulian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 23, 2026
@hkavalikas hkavalikas 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 24, 2026
Comment on lines 59 to 63
function pauseAlarm() {
audio.pause();
//I know it's said to not edit this code, I wonder if it's ok to add this line below in order to pause the time before the time runs out.
clearInterval(intervalId);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sure thing, what if I told you that you can have multiple event listeners for the same element?

@hkavalikas hkavalikas 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 Mar 24, 2026
@Elisabeth-Matulian Elisabeth-Matulian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 26, 2026
@hkavalikas hkavalikas 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. Reviewed Volunteer to add when completing a review with trainee action still to take. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 27, 2026
@Elisabeth-Matulian Elisabeth-Matulian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 27, 2026
@hkavalikas hkavalikas 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. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 28, 2026
@hkavalikas
Copy link
Copy Markdown

Awesome work

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants