Skip to content

Conversation

shreefAhmedM
Copy link

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Her is JavaScript challenges tasks covering running test, error fixing, code interpretation, and a stretch exploration activity.

@shreefAhmedM shreefAhmedM added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 28, 2025
@LonMcGregor LonMcGregor added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Oct 7, 2025
Copy link

@LonMcGregor LonMcGregor left a 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);

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");

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) {

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)) {

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?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Oct 7, 2025
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 with trainee action still to take.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants