Skip to content

Conversation

HoussamLh
Copy link

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

  • This pull request to deal with the title. I don't know what's wrong with the title. However, I tried many ways and even changed the branche name.

Questions

  • Can you let me know what's wrong with the title, please?

HoussamLh and others added 27 commits June 17, 2025 23:30
Moved padStart(2, "0") to a single location after calculating rawHour.
Improves readability and makes the function easier to maintain.
Thanks for the helpful suggestion!
@HoussamLh HoussamLh added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 9, 2025
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Sep 10, 2025
Copy link

@LonMcGregor LonMcGregor left a comment

Choose a reason for hiding this comment

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

Good start on this sprint's tasks, You have solved all of these tasks well. I have spotted a few areas where you could improve code further.

Regarding your question about titles in the PR - I'm not sure I understand what you are asking. If you mean the title format, follow the instructions in any errors that get notified. If there are no notes, it is formatted correctly.

// =============> write your new code here
// =============> write your new code here
function capitalise(str) {
let capitalisedStr = `${str[0].toUpperCase()}${str.slice(1)}`;

Choose a reason for hiding this comment

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

Renaming the variable allows you to fix the bug, great!

The pattern here is you are defining a variable and then immediately returning it. Can you think how to make this code even simpler?

Copy link
Author

Choose a reason for hiding this comment

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

Hi LonMcGregor,

Thank you for your feedback.

I see what you mean — I don’t actually need the extra variable here.
I can simplify it by returning the string directly, Like this :

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

because this way the function is shorter and still clear.


function convertToPercentage(decimalNumber) {
const percentage = `${decimalNumber * 100}%`;
return percentage;

Choose a reason for hiding this comment

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

I have the same comment as in task 0 - this works, but could be simplified further

Copy link
Author

Choose a reason for hiding this comment

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

Hi LonMcGregor,

Thank you! I see your point — the extra variable isn’t needed here either. I can simplify it by returning the result directly, like:

function convertToPercentage(decimalNumber) {
return ${decimalNumber * 100}%;
}

This makes it cleaner while keeping the same functionality.

@LonMcGregor LonMcGregor 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. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Sep 10, 2025
@HoussamLh HoussamLh added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed 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 Sep 10, 2025
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