-
-
Notifications
You must be signed in to change notification settings - Fork 218
Glasgow | 25-ITP-SEP | Shreef Ibrahim | Sprint 3 | Coursework #717
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?
Glasgow | 25-ITP-SEP | Shreef Ibrahim | Sprint 3 | Coursework #717
Conversation
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.
Good start on this sprint's tasks, most of it is really good. I have spotted a few areas where you could improve code further
// write one test at a time, and make it pass, build your solution up methodically | ||
// just make one change at a time -- don't rush -- programmers are deep and careful thinkers | ||
function getCardValue(card) { | ||
let rank = card.length === 1 ? card : card.slice(0, -1); |
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.
What circumstances would you have a card of length 1? A card in this case is always a rank + a symbol
}); | ||
// Case 3: Handle Face Cards (J, Q, K): | ||
test("should return the value 10, a card with a rank of ('10', 'J', 'Q', or 'K')", () => { | ||
const aceofSpades = getCardValue("K"); |
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.
Same comment I gave above - This is a king, but which king, hearts? spades?
if (last2Digit >= 11 && last2Digit <= 13) { | ||
return num + "th"; | ||
} | ||
if (las1Digit === 1) { |
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.
When you have a long series of if checks like this, is there another conditional structure that might be more appropriate to use?
} | ||
|
||
module.exports = passwordValidator; | ||
if (oldPassword.includes(password)) { |
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.
Could you simplify this final check?
Self checklist
Her is JavaScript challenges tasks covering running test, error fixing, code interpretation, and a stretch exploration activity.