-
-
Notifications
You must be signed in to change notification settings - Fork 195
LONDON | May-2025 | Aida Eslamimoghadam| Module-Structuring-and-Testing-Data | Sprint-3 #578
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
base: main
Are you sure you want to change the base?
Conversation
const number = parseInt(rank); | ||
if (number >= 2 && number <= 9) return number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In JavaScript, strings that represent valid numeric literals in the language can be safely converted to equivalent numbers or parsed into integers. For examples, "0x02", "2.1", or "00_02".
Does your function return the value you expected from each of the following function calls?
getCardValue("0x02♠");
getCardValue("2.1♠");
getCardValue("00_02♠");
getCardValue("2XYZ♠");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code returns 2 for ‘0x02♠’, ‘2.1♠’, and ‘2XYZ♠’, but it throws an error for ‘00_02 because it can’t read underscores (00_02) ==> becomes NaN, so it gives an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should any of them of them be treated as valid card rank?
Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
Outdated
Show resolved
Hide resolved
@fernandamelov I am sorry that I didn't notice the "Review in progress" label when I started the review. |
Changes look good. Well done.
I won't get notified when you changed the PR description, and I almost missed what you changed in the PR description. Leaving comments and changing labels will do. If needed, you can also tag me. |
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
Completed all tasks mentioned in the requirements
Reviewed the implementation with ChatGPT to ensure correctness
UPDATE
Hi CJ,
Thanks for your reviews and suggestions. I’ve updated my code. Please let me know if I need to change anything else.
Thanks a million!
Changelist