London | 26-ITP-May | Zadri Abdule | Sprint 3 | Implement & rewrite tests#1329
Open
Zadri415 wants to merge 10 commits into
Open
London | 26-ITP-May | Zadri Abdule | Sprint 3 | Implement & rewrite tests#1329Zadri415 wants to merge 10 commits into
Zadri415 wants to merge 10 commits into
Conversation
cjyuan
reviewed
Jun 5, 2026
cjyuan
left a comment
Contributor
There was a problem hiding this comment.
Very solid function implementation and tests.
| expect(isProperFraction(0, -100)).toEqual(true); | ||
| }); | ||
|
|
||
| test(`should return true when absolute value of numerator is less than absolute value of denominator`, () => { |
Contributor
There was a problem hiding this comment.
Note: Using pseudocode and notations like abs(...) or | ... | is a common and widely accepted practice for describing conditions in a concise manner.
Refactor getCardValue function to remove unnecessary checks for numeric ranks.
cjyuan
reviewed
Jun 12, 2026
| // execute the code to ensure all tests pass. | ||
|
|
||
| const validSuits = ["♠", "♣", "♥", "♦"]; | ||
| const validRanks = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A"]; |
Contributor
There was a problem hiding this comment.
What's the purpose of preparing validRanks? Could using it simplify the solution?
Author
There was a problem hiding this comment.
To check if rank is valid, instead of comparing it to each value one by one.
Contributor
There was a problem hiding this comment.
Sounds good. Why not implement what you described? Otherwise, it is best practice to remove all unused variables to keep the code clean.
Contributor
|
Changes look good. |
Author
|
Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Added Jest tests for Sprint-3 implement and rewrite (exercises 1–3)