Skip to content

London | 26-ITP-May | Gideon Defar | Sprint 3 | Alarm Clock App - #1423

Open
gideondefar wants to merge 5 commits into
CodeYourFuture:mainfrom
gideondefar:feature/alarm-clock
Open

London | 26-ITP-May | Gideon Defar | Sprint 3 | Alarm Clock App#1423
gideondefar wants to merge 5 commits into
CodeYourFuture:mainfrom
gideondefar:feature/alarm-clock

Conversation

@gideondefar

Copy link
Copy Markdown

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

Implemented the Alarm Clock assignment.
Updated the page title to "Alarm clock app"
Added the alarm countdown functionality
Added minute and second formatting
Added a countdown that updates every second
Added alarm playback when the countdown reaches zero
Kept the existing Stop Alarm functionality

@gideondefar gideondefar 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 Aug 12, 2026
Comment thread Sprint-3/alarmclock/alarmclock.js Outdated

function setAlarm() {

if (timer) clearInterval(timer);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In the browser, start a 10-second countdown, then clear the input box and click Set Alarm again. What happens to the countdown, and is that what a user would expect? Have a look at the order of this line and line 23.

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.

Now it keeps countdown to 0.

Comment thread Sprint-3/alarmclock/alarmclock.js Outdated
audio.currentTime = 0;

let time = Number(document.getElementById("alarmSet").value);
if (isNaN(time) || !Number.isInteger(time) || time <= 0) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Run Number.isInteger(NaN) into your browser console and what comes back? Is the isNaN(time) check earning its place here?

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.

You are right, It's kind of redundant, So I removed it. !Number.isInteger(time) already checks the condition.

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

function updateDisplay(time) {

let heading = document.getElementById("timeRemaining");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

None of these three are ever reassigned. What's your rule for picking between let and const?

@gideondefar gideondefar Aug 15, 2026

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.

Thanks for the feedback! ooh I see you are right. I use let basically to reassign the variable later but const is for fixed or constant variables.

@gideondefar gideondefar added the Core This is a core task and should be completed by all trainees label Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core This is a core task and should be completed by all trainees Module-Data-Groups The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants