Skip to content

London | 26-Jan-ITP | Angela McLeary | Sprint 1|Coursework/sprint 1#990

Open
AngelaMcLeary wants to merge 20 commits intoCodeYourFuture:mainfrom
AngelaMcLeary:coursework/sprint-1
Open

London | 26-Jan-ITP | Angela McLeary | Sprint 1|Coursework/sprint 1#990
AngelaMcLeary wants to merge 20 commits intoCodeYourFuture:mainfrom
AngelaMcLeary:coursework/sprint-1

Conversation

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

This PR is focused on understanding the existing codebase and deepening my knowledge of JavaScript concepts.
It involves interpreting the current implementation, analyzing how different parts interact, identifying and understanding errors, and using Chrome DevTools to inspect runtime behavior and debug issues.

Questions

What is the difference between a function and a methods?

@AngelaMcLeary AngelaMcLeary added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 19, 2026
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Feb 25, 2026
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 work on these tasks.

To figure out the difference between a function and a method,you need to consider objects (you may or may not have come across these yet in your study). Functions are written by you, methods are written as part of objects. This is a good site with an exaplantion: https://www.geeksforgeeks.org/javascript/difference-between-methods-and-functions-in-javascript/
Does that help you understand the difference?


// In this exercise, you will need to work out what num represents?
//*Answer:
//Number returns a random whole number between 1 and 100.

Choose a reason for hiding this comment

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

Can you figure out the limits more precisely? Think about if it includes or excludes those numbers?

Copy link
Author

Choose a reason for hiding this comment

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

@LonMcGregor Thanks for your question.
I can see it is not very clear. "num" returns a random whole number between 1 and 100 inclusive. It can never go below 1 or over 100.

// When declaring a variable it must not start with a number, space or reserved word.
// to fix this, we can rename them correctly.

const twelve_HourClockTime = "20:53";

Choose a reason for hiding this comment

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

here you have mixed variable naming using snake_case and PascalCase. Can you see the difference?

Copy link
Author

Choose a reason for hiding this comment

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

@LonMcGregor thanks for your feedback.
I have mixed them up, I see that I should use camelCase for functions and variables. I will update the code.
Thank you
Angela.

// 1200 returned 0:20:00
// 92383.7 returned 25:39:43.69999999999709
// -8784 returned -2:-26:-24
// it worked with all numbers including decimals and negative numbers.

Choose a reason for hiding this comment

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

Just note that when you tested these, though it ran without errors, does the output look OK, or are there values where it looks incorrect?

Copy link
Author

@AngelaMcLeary AngelaMcLeary Feb 25, 2026

Choose a reason for hiding this comment

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

@LonMcGregor another good question.
Line 46: Milliseconds appeared in the output because they were part of the input and were not explicitly removed, even though they were not required and it does make the output not what is expected.

Line 47: Negative numbers passed the test. In reality there should not be negative time in the movieLength and it should throw an error.

In both cases there was no validation to stop this from occurring.

Thank you
Angela.

@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 Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants