Skip to content

Conversation

@ldfajardo10-tech
Copy link

Learners, PR Template

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

Exercise solutions sprint 3 practice tdd

if (numerator < denominator) {
return true;
}
if (numerator > denominator) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those ifs are unnecessary, because after the first if fails, its obvious that it is either equal or bigger.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only return false; was enough. But not a big issue

const numRank = Number(rank); //to convert any numeric string in an actual numeric value. Example: "5" !== 5
if (rank == "A") {
return 11;
} else if (rank === "J" || rank === "Q" || rank === "K") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add rank 10 also please.

// Given a card with an invalid rank (neither a number nor a recognized face card),
// When the function is called with such a card,
// Then it should throw an error indicating "Invalid card rank."
const invalidCard1 = getCardValue("10Q");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would fail no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants