Skip to content

Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 2 | coursework #1439

Open
meneogbemi42-bit wants to merge 17 commits into
CodeYourFuture:mainfrom
meneogbemi42-bit:coursework/sprint2
Open

Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 2 | coursework #1439
meneogbemi42-bit wants to merge 17 commits into
CodeYourFuture:mainfrom
meneogbemi42-bit:coursework/sprint2

Conversation

@meneogbemi42-bit

@meneogbemi42-bit meneogbemi42-bit commented Jul 2, 2026

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

This PR contains debugging, implementation, and interpretation work across multiple coding exercises focusing on function parameters, return values, and string manipulation in JavaScript.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit added 🏕 Priority Mandatory This work is expected Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 2, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@github-actions

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit changed the title Birmingham Coursework/sprint2 Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 2 | Coursework/sprint2 Jul 2, 2026
@meneogbemi42-bit meneogbemi42-bit added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@github-actions

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@meneogbemi42-bit meneogbemi42-bit changed the title Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 2 | Coursework sprint2 Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 2 | data testing Jul 2, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@meneogbemi42-bit meneogbemi42-bit added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. and removed 🏕 Priority Mandatory This work is expected labels Jul 2, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit changed the title Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 2 | data testing Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 2 | coursework Jul 2, 2026
@github-actions

This comment has been minimized.

@meneogbemi42-bit meneogbemi42-bit added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 2, 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

return `${str[0].toUpperCase()}${str.slice(1)}`;

}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Really good explanation of scope and variable declarations here, just wanted to highlight the extra if statement you added. Are you sure it handles the empty string case like you describe?

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 is the best explanation i could come up with.

By checking typeof str !== "string", you are asking: "If the input is anything other than a string, stop processing and just return the input exactly as it is." If you send a string: It skips the if block and proceeds to do the work.
If you send a number: The if condition is true, so it returns the number and ignores the rest of the function.

// =============> the explanation:
// The function sum has a return statement before the addition operation, which causes the function to return undefined immediately.
// To fix this, the return statement should be placed after the addition operation.
// because the function is not a string i have to remove the backticks and use a normal string concatenation to print the result correctly.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

// because the function is not a string i have to remove the backticks and use a normal string concatenation to print the result correctly.

What happens if you tried to use the backticks here with a function that returns a number?

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.

If you use backticks with a function that returns a number, JavaScript will automatically convert that number into a string so it can be combined with the rest of your text. just wanted to indicate that i was not working with string functions

.padEnd(2, "0");

return `£${pounds}.${pence}`;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Be wary of code formatting - because you copied and pasted this code from another file, none of the code within the function body is indented, which makes it harder to read.

Prettier is a really useful extension to help with formatting. You don't have to use it, but either way - please fix the formatting 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.

done and corrected. thanks for the correction.

Comment on lines +34 to +41

console.assert(formatAs12HourClock("15:00") === "03:00 pm", `Failed Case D: 03:00 pm`);
console.assert(formatAs12HourClock("13:00") === "01:00 pm", `Failed Case E: 01:00 pm`);
console.assert(formatAs12HourClock("15:45") === "03:45 pm", `Failed Case D: 03:45 pm`);
console.assert(formatAs12HourClock("13:45") === "01:45 pm", `Failed Case E: 01:45 pm`);
console.assert(formatAs12HourClock("08:45") === "08:45 am", `Failed Case F: 08:45 am`);

console.log("All current assertions completed!"); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks great so far but there's a couple of edge cases I think you should consider: midnight and midday. Think about how you they'd be displayed on both a 24-hour and 12-hour setup and make sure they are included in your test coverage.

Note: these are the kinds of "edge cases" referred to in the instructions.

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 have sent the correct code to address the edge case

@Liam310

Liam310 commented Jul 6, 2026

Copy link
Copy Markdown

Really nice explanations Ogbemi! Just a few comments but good work overall.

@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 7, 2026
@meneogbemi42-bit meneogbemi42-bit 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

Module-Structuring-And-Testing-Data The name of the module. 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