Skip to content

London | Jan2026 | Ihor Taradaiko | Sprint 2 | Coursework/sprint 2#989

Open
ihortar wants to merge 12 commits intoCodeYourFuture:mainfrom
ihortar:coursework/sprint-2
Open

London | Jan2026 | Ihor Taradaiko | Sprint 2 | Coursework/sprint 2#989
ihortar wants to merge 12 commits intoCodeYourFuture:mainfrom
ihortar:coursework/sprint-2

Conversation

@ihortar
Copy link

@ihortar ihortar commented Feb 19, 2026

  • - 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

Completed the following exercises:

Key Errors
Mandatory Debug
Mandatory Implement
Mandatory Interpret

@ihortar ihortar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 19, 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 Feb 19, 2026
@github-actions

This comment has been minimized.

@ihortar ihortar closed this Feb 19, 2026
@ihortar ihortar reopened this Feb 19, 2026
@github-actions

This comment has been minimized.

@ihortar ihortar force-pushed the coursework/sprint-2 branch from 51e880d to 66ef47c Compare February 19, 2026 12:51
@ihortar ihortar added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 19, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

There are a few more exercises in Sprint-2/1-key-errors.

// Predict and explain first...
// =============> write your prediction here

// =============> write your prediction here - should show undefined as there are ";" after return inside the function
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you expect from the following function calls?

function sum3(a, b) {
  return
  a + b;
}

function sum4(a, b) {
  return a
  + b;
}

console.log(sum3(1, 2));
console.log(sum4(1, 2));

Copy link
Author

Choose a reason for hiding this comment

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

Aren't those the same?
3
3

Copy link
Contributor

Choose a reason for hiding this comment

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

Not the same result. You can test them, and use AI to find out why.

Copy link
Author

Choose a reason for hiding this comment

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

Oh, I didn't know that! The JS auto considers there is ";" after return if there is nothing else in the row

Comment on lines 8 to 29
function toPounds(str)
{
// 1. const penceString = "399p": initialises a string variable with the value "399p"
const penceStringWithoutTrailingP = str.substring(
0,
str.length - 1
);

//2. removes "P" from the string
const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0");
//3. Ensures the string is at least 3 characters long by adding 0 to the start
const pounds = paddedPenceNumberString.substring(
0,
paddedPenceNumberString.length - 2
);

//4. Extracts everything except the last 2 digits of paddedPenceNumberString
const pence = paddedPenceNumberString
.substring(paddedPenceNumberString.length - 2)
.padEnd(2, "0");
return pence
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally, code inside a block is indented one level deeper than the block itself.

You can also consider installing the prettier VSCode extension and then use the VSCode's "Format document" function" to automatically indent code.

Copy link
Author

Choose a reason for hiding this comment

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

I actually have it, would be great to have the button in the UI, not in the right click

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not try completing the implementation of formatAs12HourClock(time)?

Copy link
Author

Choose a reason for hiding this comment

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

I was too lazy, will try to.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's never a good excuse!

@cjyuan
Copy link
Contributor

cjyuan commented Feb 25, 2026

In the PR description, can you update the Markdown syntax to make the PR description more like this?

  • 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

  • Key Errors
  • Mandatory Debug
  • Mandatory Implement
  • Mandatory Interpret

@cjyuan cjyuan 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 Feb 25, 2026
@ihortar ihortar 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 Feb 25, 2026
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Changes look good.

Well done.

if (hours > 12) {
return `${hours - 12}:00 pm`;
const hours = Number(time.slice(0, 2));
const minutes = time.slice(3, 5);
Copy link
Contributor

Choose a reason for hiding this comment

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

.slice(-2) is probably more expressive to mean "extract the last two characters".

Copy link
Contributor

Choose a reason for hiding this comment

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

That's never a good excuse!

@cjyuan cjyuan 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. labels Feb 25, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Feb 25, 2026

You didn't update the Changelist!

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