Cape Town | 26-ITP-May | Shafiek Walker | Sprint 3 | Implement and Rewrite Tests - #1390
Conversation
LonMcGregor
left a comment
There was a problem hiding this comment.
Good start on this task, I've left a few pointing questions to help you improve your solutions
| function isProperFraction(numerator, denominator) { | ||
| // TODO: Implement this function | ||
| if ( numerator < denominator && numerator > 0 && denominator > 0) { | ||
| return true; |
There was a problem hiding this comment.
Here you are returning true or false depending on the condition in your if statement. Is there a way you could simplify this?
Also, does it work for negative numerators?
|
|
||
| function getCardValue(card) { | ||
| // TODO: Implement this function | ||
| if (card === "A♠" || card === "A♥" || card === "A♦" || card === "A♣") { |
There was a problem hiding this comment.
Is there a way you could simplify this code so you avoid having 4 conditions for every single card type?
LonMcGregor
left a comment
There was a problem hiding this comment.
Great work, these tasks are complete. Combining your fraction conditions into a single return value separated by ANDs is a good simplification.
|
Hi LonMcGregor,
Thanks so much for the review and the helpful feedback! I really appreciate
it.
…On Wed, Jul 1, 2026 at 11:02 AM LonMcGregor ***@***.***> wrote:
***@***.**** commented on this pull request.
Great work, these tasks are complete. Combining your fraction conditions
into a single return value separated by ANDs is a good simplification.
—
Reply to this email directly, view it on GitHub
<#1390?email_source=notifications&email_token=A4CDQ6WHVJ25LS5PLRZ4FNL5CTHTFA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINRQG4ZTOMJTGIY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-4607371321>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4CDQ6XJWP6BH5GYZRFMB2D5CTHTFAVCNFSNUABFKJSXA33TNF2G64TZHM3TSOJSGQ2TGNRYHNEXG43VMU5TINZSGQ3DEOBWGE3KC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/A4CDQ6SG5HGDUYG6AWK6VZL5CTHTFA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINRQG4ZTOMJTGIY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/A4CDQ6Q3STLKZSQ6T7XMME35CTHTFA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINRQG4ZTOMJTGIY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/1390/review/4607371321
@github.com>
|
|
Closing PR because the May ITP run has finished. Feel free to re-open if you're still working on it. |
Learners, PR Template
Self checklist
Changelist
Completed the Sprint 3 "Implement and Rewrite Tests" exercises.
Implemented the required functions, rewrote the tests where needed, and verified that all tests pass using
npm test.