Skip to content

London | 26-ITP-Sep | Rawan Almutairi | Sprint2 | JavaScript exercises - #1628

Open
Rawan0-0 wants to merge 1 commit into
CodeYourFuture:mainfrom
Rawan0-0:sprint-2
Open

Rawan0-0 wants to merge 1 commit into
CodeYourFuture:mainfrom
Rawan0-0:sprint-2

Conversation

@Rawan0-0

@Rawan0-0 Rawan0-0 commented Sep 29, 2026 •

Copy link
Copy Markdown

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

Task code

(e.g. CYF-1039).

Changelist

Sprint 2 work

Questions

No questions

@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit f6c55f9
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6abb00bcb2c433000869b018
😎 Deploy Preview https://deploy-preview-1628--cyf-onboarding-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
2 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 86 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@Rawan0-0 Rawan0-0 added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 29, 2026
@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

1 similar comment
@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 29, 2026

@iscmiguelsamaniego iscmiguelsamaniego left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fantastic work! Your technical grasp, attention to edge cases (like octal numbers), and step-by-step code breakdowns are spot-on.

Keep up this meticulous approach—you are making brilliant progress!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job! You correctly identified how the variable is initialized and reassigned.

Quick question: How would you specifically describe the role of the = sign in that second line?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job! This is a very clean and clever solution using template literals and bracket notation.

Quick question: Is there another built-in string method besides bracket notation you could use to get the first character?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spot-on implementation for extracting dir and ext! To polish your code, you can make the comments a bit more direct and concise.

Quick question: When using filePath.slice(0, lastSlashIndex) for dir, why do we include 0 as the starting index, and what happens if you omit it?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Clear breakdown of the math logic!

Just remember the order: Math.random() runs first to generate a decimal, then the math scales it, and finally Math.floor() rounds it down.

Quick question: What purpose does the + 1 serve inside (maximum - minimum + 1)?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spot-on distinction between const and let for handling variable updates.

Quick question: Is there a shorthand assignment operator you could use instead of writing age = age + 1?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not quite a ReferenceError here—cardNumber is actually declared, but because it's a number rather than a string, JavaScript throws a TypeError because .slice() isn't a valid method for numbers.

Quick question: What method can you call on cardNumber to convert it into a string first so .slice(-4) will work?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spot-on explanation! Variable names cannot start with numbers.

Quick question: While starting with a capital letter works syntactically, what is the standard JavaScript naming convention (case style) usually used for variables made of multiple words like this?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spot-on answers! Your breakdown of line 5's syntax error, reassignments, and the purpose of replaceAll() is completely accurate.

Quick question: Why is replaceAll() a better choice here than a standard replace() method?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spot-on analysis! Your observation about leading zeros triggering an octal syntax error is a brilliant and advanced catch.

Quick question: If remainingSeconds is 5, the output currently shows ...:5 instead of ...:05. How might you ensure single-digit numbers always display with two digits?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great step-by-step breakdown! You clearly traced how substring, padStart, and padEnd work together to parse and format the price string correctly.

Quick question: Why is padStart(3, "0") particularly important if someone inputs a smaller value like "9p" instead of "399p"?

@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

5 similar comments
@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@Rawan0-0 Rawan0-0 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed 📅 Sprint 2 Assigned during Sprint 2 of this module labels Sep 30, 2026
@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

2 similar comments
@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@Rawan0-0

Copy link
Copy Markdown
Author

Fantastic work! Your technical grasp, attention to edge cases (like octal numbers), and step-by-step code breakdowns are spot-on.

Keep up this meticulous approach—you are making brilliant progress!

Thank you so much for this wonderful feedback. I certainly will check each one and submit my work for each one. It was really good to hear that I did a good job; I was really worried I might have made some mistakes.

@Rawan0-0 Rawan0-0 added the 📅 Sprint 2 Assigned during Sprint 2 of this module label Sep 30, 2026
@github-actions

Copy link
Copy Markdown

Your PR's title isn't in the expected format.

Please check the expected title format, and update yours to match.

Reason: Sprint part (Sprint2) doesn't match expected format (example: 'Sprint 2', without quotes)

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

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. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants