Skip to content

Comments

London | 26-ITP-Jan | Johnny Vargas | Sprint 1 | Coursework#968

Open
JohnnyBoyV wants to merge 19 commits intoCodeYourFuture:mainfrom
JohnnyBoyV:coursework/sprint-1
Open

London | 26-ITP-Jan | Johnny Vargas | Sprint 1 | Coursework#968
JohnnyBoyV wants to merge 19 commits intoCodeYourFuture:mainfrom
JohnnyBoyV:coursework/sprint-1

Conversation

@JohnnyBoyV
Copy link

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

I followed the questions in each js & md file and commented answers or directly changed code as requested by the questions.

@github-actions

This comment has been minimized.

@JohnnyBoyV JohnnyBoyV added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 14, 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 14, 2026
@JohnnyBoyV JohnnyBoyV changed the title London | 26-ITP-Jan | Johnny Vargas | Sprint 2 | Coursework London | 26-ITP-Jan | Johnny Vargas | Sprint 1 | Coursework Feb 14, 2026
@JohnnyBoyV JohnnyBoyV added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 14, 2026
@hkavalikas hkavalikas 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 Feb 19, 2026
@hkavalikas hkavalikas self-requested a review February 19, 2026 08:01
@hkavalikas hkavalikas 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 Feb 19, 2026

Choose a reason for hiding this comment

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

Awesome one, this is mostly correct, although less common, there is a case that can break this, what would happen if we have a file/directory name with a dot? Can we update the implementation slightly so we can handle that?

const age = 33;
age = age + 1;


Choose a reason for hiding this comment

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

Spot on, let's take it a step further and fix the code itself too

const cityOfBirth = "Bolton";


// The 'ReferenceError' occurs because the code tries to use the variable cityOfBirth before it has been defined.

Choose a reason for hiding this comment

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

Same as the other file, let's also fix the code itself



// I predict an error will happen because cardNumber is a number and not a string and slice can not be used for pure numbers.
// We can fix it by turning the number into a string by using .toString() before we slice it.

Choose a reason for hiding this comment

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

The solution is mostly correct, but there is an issue with typing. By doing toString(), we have now converted last4Digits from number to string, but it's not obvious that this is a String now, and we could mistakenly try to do numeric operations on it. Once we are done slicing the value, how can we convert it back to the original type?

// 4, 5, 10.

// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?
// It is coming from line 5. Because ("," "") is missing a comma separating the strings.

Choose a reason for hiding this comment

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

Awesome, let's implement the comment and fix the code itself too

// A better name for it could be movieLengthFormatted.

// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
// If the seconds are a single digit like "5", the result will look something like 2:26:5. It makes it look unprofessional compared to say 02:26:05. No newline at end of file

Choose a reason for hiding this comment

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

Good answer, can you try to spot a few more values/cases to test against?

@JohnnyBoyV JohnnyBoyV 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 20, 2026
@JohnnyBoyV
Copy link
Author

Thanks, made the changes requested.

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