Skip to content

London | 26-ITP-May | Bisrat Tesfay | Sprint 2 | Coursework/sprint 2#1455

Open
B3-Bisrat wants to merge 7 commits into
CodeYourFuture:mainfrom
B3-Bisrat:acoursework/sprint-2
Open

London | 26-ITP-May | Bisrat Tesfay | Sprint 2 | Coursework/sprint 2#1455
B3-Bisrat wants to merge 7 commits into
CodeYourFuture:mainfrom
B3-Bisrat:acoursework/sprint-2

Conversation

@B3-Bisrat

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

All the sprint 2 coursework are done.

Questions

@B3-Bisrat B3-Bisrat added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 3, 2026
@Liam310 Liam310 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 Jul 6, 2026
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);

// =============> write your explanation here
//The function multiply(a, b) logs the result but does not return anything.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is true, but I'm looking for a little more specifics. When the line

console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);

is run, what do you see and why? Your comment should provide a thorough explanation of this.

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.

The function multiply(a, b) prints the result using console.log(a * b), but it does not return a value. When multiply(10, 32) is called inside the template literal, it first prints 320 to the console. Then, because the function has no return statement, it returns undefined. As a result, the second console.log prints:

The result of multiplying 10 and 32 is undefined

This happens because console.log() only displays a value on the screen, while return sends a value back to where the function was called.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yep, spot on - could you please update your answer in the file to use this level of detail? Then I'm happy to mark as complete 🙂

console.log(formatAs12HourClock("00:00"));
console.log(formatAs12HourClock("12:00"));

//The function did not handle the edge cases 00:00 and 12:00.

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 are absolutely correct that it didn't handle those two edge cases! Please update the function accordingly to ensure it does handle them (and also handles slightly different inputs as well, please refer to the prep steps for a reminder of the kinds of inputs you need to handle).

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! I've updated the function

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice one!

@Liam310 Liam310 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 Jul 6, 2026
@B3-Bisrat B3-Bisrat 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 Jul 6, 2026
@Liam310 Liam310 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 Jul 7, 2026
@B3-Bisrat B3-Bisrat 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 Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants