Skip to content

LONDON | May-2025 | Sisay Mehari | Module-Structuring-and-Testing-Data | Sprint-1 #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

Sisu860
Copy link

@Sisu860 Sisu860 commented Jun 10, 2025

Learners, PR Template
Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task
    Changelist
    ✅ Completed Exercises section: wrote small JavaScript programs and used MDN documentation to understand unfamiliar syntax

✅ Resolved all errors in the Errors section: ran files with Node.js... interpreted the error messages, and fixed the bugs using error documentation

✅ Interpreted and analyzed larger programs in the Interpret section: used console.log and MDN to understand syntax, operators, and functions

✅ Explored the Stretch section: reflected on key concepts and experimented with browser tools like the Chrome console.

Questions
None at the moment.

@Sisu860 Sisu860 added the Needs Review Participant to add when requesting review label Jun 10, 2025
@cjyuan cjyuan added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jun 22, 2025
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.

Explanation is clear. Good job.

I only have a few suggestions and comments.

Comment on lines 7 to 10
//Line 3 is doing: - its reads the current value of count (which is 0),
// then it adds 1 to that value (0 + 1 = 1)
// then, it reassigns that result (1) back into count variable.
// The = symbol is the assignment operator, Take the value on the right side, and store it into the variable on the left side.
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?

const ext = ;

const dir = filePath.slice(0, lastSlashIndex);
const ext = base.slice(dotIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

what is dotIndex?

// It will help to think about the order in which expressions are evaluated
// Try logging the value of num and running the program several times to build an idea of what the program is doing
//const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
//This line generates a random integer between minimum and maximum, inclusive. Here's a breakdown:
//Math.random() returns a decimal between 0 (inclusive) and 1 (exclusive).
Copy link
Contributor

Choose a reason for hiding this comment

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

We can also use the concise and precise interval notation to describe a range of values.
For example, we can say, "Math.random() returns a decimal in the interval [0, 1)"

Comment on lines 22 to 24
// Line 5:
// priceAfterOneYear.replaceAll(",", "") → Calls the replaceAll() method on priceAfterOneYear.
// Number(...) → Converts the result to a number using the Number() function.
Copy link
Contributor

Choose a reason for hiding this comment

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

line 6 should have replaced line 5.

*/
// The variable result represents the movie length formatted as a string in hh:mm:ss (hours, minutes, seconds) format.
// A better name for this variable could be:
// movieDurationFormatted (or movieTimeFormatted)
Copy link
Contributor

Choose a reason for hiding this comment

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

Placing the adjective "formatted" in front of the noun "MovieDuration" would probably make the variable name sound more natural.

// Rationale: In UK currency, the last two digits represent pence, and the digits before that represent pounds.
// 5. const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0");
// This line extracts the last 2 characters as the pence part.
// If for any reason it's shorter than 2 digits, it adds a "0" to the end to ensure the format is correct.
Copy link
Contributor

Choose a reason for hiding this comment

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

What reason would it be?
Do we really need .padEnd(2, "0") in this script?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jun 22, 2025
@Sisu860
Copy link
Author

Sisu860 commented Jun 23, 2025

Thank you so much for the thorough feedback! I've addressed all the points you raised. Looking forward to your review!

@Sisu860 Sisu860 added the Needs Review Participant to add when requesting review label Jun 23, 2025
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.

In addition to making changes, it is a common practice to also leave a response in the comment threads. Doing so makes it easier for all parties to track the discussion. You can try the approach in future PRs.
If you are up to more challenges, you can look up "best practice to respond to inline comments in a pull request", and then practice what you find in future PRs.

image

@cjyuan cjyuan added Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review Reviewed Volunteer to add when completing a review labels Jun 23, 2025
@Sisu860
Copy link
Author

Sisu860 commented Jun 23, 2025

Thanks so much for the review and for letting me know the changes look good!

I really appreciate the advice on responding to inline comments in future PRs – that makes a lot of sense for tracking discussions, and I'll definitely adopt that practice going forward.

Thanks again for all your help!

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 review comments have been addressed 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants