Skip to content

London | 26-ITP-January | Eugenie Ahangama | Sprint 1 | coursework/sprint-1 #927

Open
Eugenie-A wants to merge 21 commits intoCodeYourFuture:mainfrom
Eugenie-A:coursework/sprint-1
Open

London | 26-ITP-January | Eugenie Ahangama | Sprint 1 | coursework/sprint-1 #927
Eugenie-A wants to merge 21 commits intoCodeYourFuture:mainfrom
Eugenie-A:coursework/sprint-1

Conversation

@Eugenie-A
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

In this project, I completed both the coding exercises and practical exploration of browser based functions using the Chome DevTools console. I tested how different JavaScript features behave, documented my findings and wrote clear explanations in Markdown.

I referred to MDN documentation throughout this project:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder

Questions

Are there habits I should start building now to avoid problems later?

@Eugenie-A Eugenie-A added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 🦑 Size Large 4-8 hours 📅 Sprint 1 Assigned during Sprint 1 of this module Submit:PR Module-Structuring-And-Testing-Data The name of the module. labels Feb 3, 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.

Code looks good. I just have a few suggestions and questions.

Comment on lines 8 to 9
// The = operator assigns a new value to 'count'. It takes the current value of 'count'.
// adds 1 to it, and then stores that new value back into the 'count' variable. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Operation like count = count + 1 is very common in programming, and there is a programming term describing such operation.

Can you find out what one-word programming term describes the operation on line 3?

Copy link
Author

Choose a reason for hiding this comment

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

I have updated the comment on line 3 to be more concise and included the one word programming term you were asking for: increment.

Comment on lines 11 to 12
// Generate a random decimal number between 0 and 1
const decimal = Math.random();
Copy link
Contributor

Choose a reason for hiding this comment

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

Phrases like "a number between X and Y" are not precise enough in a program specification, because they do not clearly state whether the endpoints X and Y are included.

We can use the concise and precise interval notation to describe a range of values.

  • [, ] => inclusion
  • (, ) => exclusion
    For example, we can say, "Math.random() returns a random number in the interval [0, 1)"

Copy link
Author

Choose a reason for hiding this comment

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

I've updated the comment to use precise interval notation. It now matches the official Math.random() behaviour (≥ 0 and < 1).

Comment on lines +38 to +39
// 5. const pence = paddedPenceNumberString .substring(paddedPenceNumberString.length - 2) .padEnd(2, "0"):
// Takes the final two digits of the padded string to form the pence portion
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code?
In other words, do we really need .padEnd(2, "0") in this script?

Copy link
Author

Choose a reason for hiding this comment

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

After testing: removing .padEnd(2, "0") doesn't change the output for valid inputs (e.g. "399p" → "£3.99") because .padStart(3, "0") already gurantees the last two characters are correctly padded.

So no, you don't really need .padEnd(2, "0") in this code, the output remains correct without it.

Comment on lines 19 to 20
- The console stores a history of messages your code prints while it runs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this question is asking, "what properties can be found in the object assigned to the variable console.

I don' think the stores the text that has already been output.

Copy link
Author

Choose a reason for hiding this comment

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

You are totally right, the question is about the properties/methods of the console object itself, not the output history. Thank you for the feedback!

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

Labels

Module-Structuring-And-Testing-Data The name of the module. 🏕 Priority Mandatory This work is expected Reviewed Volunteer to add when completing a review with trainee action still to take. 🦑 Size Large 4-8 hours 📅 Sprint 1 Assigned during Sprint 1 of this module Submit:PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants