Skip to content

Comments

London | 26-ITP-JAN | Shuheda Begum | Sprint 1 | Structuring and Testing Data#937

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

London | 26-ITP-JAN | Shuheda Begum | Sprint 1 | Structuring and Testing Data#937
codebyshay wants to merge 19 commits intoCodeYourFuture:mainfrom
codebyshay:coursework/sprint-1

Conversation

@codebyshay
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

Did exercise 1.

Questions

N/A

Initials fixed
const dir and const ext
What does num represent with explanation
Adding // to make a comment or add instructions for human consumption.
let allows variable age, const does not.
Swapped the position of const from under the console to on top of the console to allow javascript to read it in order.
Add String to the cardNumber so javascript recognises it as a string and not just numbers, making it possible to slice.
SyntaxError fixed..twelve instead of 12 and twentyFour instead of 24
Answered all questions and added , to the function.
Answered questions
Explain each step one by one.
Answered questions and tried alert and prompt on chrome dev tool.
Completed dev tool exercise on chrome.
@codebyshay codebyshay added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 10, 2026
@codebyshay codebyshay changed the title London | 26-ITP-JAN | Shuheda Begum | Sprint 1 | Sprint-1 London | 26-ITP-JAN | Shuheda Begum | Sprint 1 | Structuring and Testing Data Feb 10, 2026
@Theoreoluwa Theoreoluwa 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 18, 2026
Comment on lines 6 to 8

// The code above will output 34, because we are reassigning the value of age to be the current value of age plus 1. So, 33 + 1 = 34.

Choose a reason for hiding this comment

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

Do you think the explanation provided here hit the major reason why the error was occurring even if you did the right thing in your code?

Copy link
Author

Choose a reason for hiding this comment

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

No. I have now included this . Thank you.

@@ -1,9 +1,12 @@
const cardNumber = 4533787178994213;
const last4Digits = cardNumber.slice(-4);
const last4Digits = String(cardNumber).slice(-4);

Choose a reason for hiding this comment

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

Now, you did the right thing by explaining your reasoning to debug the error. I would suggest applying a much cleaner way to convert the variable into a string without redeclaring it. You can look into that method using MDN docs.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, thank you.


// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer

// This code will work for all positive integer values of movieLength. It will correctly calculate the hours, minutes and seconds for any length of movie. However, if movieLength is negative or not an integer, the code may not work as intended. For example, if movieLength is -100, the calculations will not make sense in the context of a movie length. If movieLength is a decimal, it may also cause issues with the calculations. 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.

Have you considered if there could be some time formatting issues with smaller integer numbers?

Copy link
Author

Choose a reason for hiding this comment

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

I didn't think of that. I will have a look at this now.

Copy link

@Theoreoluwa Theoreoluwa left a comment

Choose a reason for hiding this comment

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

Great job so far; kindly look into the comments to make it better. Well done.

@Theoreoluwa Theoreoluwa 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 18, 2026
@codebyshay
Copy link
Author

Thank you. I've looked though the comments and have amended as necessary.

@codebyshay codebyshay 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 21, 2026
@Theoreoluwa Theoreoluwa 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 24, 2026
Comment on lines +54 to +69

const movieLength = 65;

const remainingSeconds = movieLength % 60;
const totalMinutes = (movieLength - remainingSeconds) / 60;

const remainingMinutes = totalMinutes % 60;
const totalHours = (totalMinutes - remainingMinutes) / 60;

const formattedHours = String(totalHours).padStart(2, "0");
const formattedMinutes = String(remainingMinutes).padStart(2, "0");
const formattedSeconds = String(remainingSeconds).padStart(2, "0");

const movieDurationString = `${formattedHours}:${formattedMinutes}:${formattedSeconds}`;

console.log(movieDurationString); // 00:01:05

Choose a reason for hiding this comment

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

While I understand you might have misinterpreted my comment, the point I made was not for an explicit change of the code to work with a certain range of numbers. The rationale, as seen in the task, is to explain your rationale for your answer as to how various values will work when passed into the movieLength variable.

Copy link

@Theoreoluwa Theoreoluwa left a comment

Choose a reason for hiding this comment

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

Well done. Great job. I will mark the task as complete, but I would encourage you to check through my comment and ensure you understand the task requirements properly. Keep going!

@Theoreoluwa Theoreoluwa added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 24, 2026
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