Skip to content
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

Millena mesfin/Sprint-2-exercices /structuring and testing data #221

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

Conversation

Millena28
Copy link

@Millena28 Millena28 commented Dec 9, 2024

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 COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

Copy link
Author

@Millena28 Millena28 left a comment

Choose a reason for hiding this comment

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

Hi i would appreciate it if someone could review my PR?

@Millena28 Millena28 added the Needs Review Participant to add when requesting review label Dec 9, 2024
Copy link

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

The code in Sprint-2/debug/2.js is not quite correct.

Everything else is good.

// Line#5; we need to make getLastDigit accept a parameter.

function getLastDigit(number) {
return num.toString().slice(-1);
Copy link

@cjyuan cjyuan Dec 11, 2024

Choose a reason for hiding this comment

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

Have you executed your script to verify your function can correctly return the last digit?

I don't think console.log( getLastDigit(806) ) will output 6 with your current implementation.

// .replace(/ /g, "_") uses a regular expression to replace all spaces in the string with underscores (_), where the /g flag ensures that all spaces are replaced (not just the first one).
// Using .replace(/ /g, "_") with the g flag tells JavaScript to replace all spaces in the string, not just the first one.
// /g: Replaces all occurrences of the pattern, but is case-sensitive.
// /gi: Replaces all occurrences of the pattern and is case-insensitive.
Copy link

Choose a reason for hiding this comment

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

You are using / /gi (instead of / /g) in your code. How does the i flag affect the result?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Dec 11, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants