We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bfd808 commit 7c6010aCopy full SHA for 7c6010a
Sprint-3/2-mandatory-rewrite/3-get-card-value.js
@@ -4,9 +4,9 @@ function getCardValue(card) {
4
const rank = card.slice(0, -1); // Extract rank (everything except the last character)
5
if (rank === "A") return 11; // handle Ace as 11
6
if (["K", "Q", "J"].includes(rank)) return 10; // handle face cards as 10
7
- const numerincRank = parseInt(rank); //Handle number cards 2–9
8
- if (numerincRank >= 2 && numerincRank <= 9) {
9
- return numerincRank; // Return the numeric value for cards 2-9
+ const numericRank = parseInt(rank); //Handle number cards 2–9
+ if (numericRank >= 2 && numericRank <= 9) {
+ return numericRank; // Return the numeric value for cards 2-9
10
}
11
// Invalid card rank
12
return 0;
0 commit comments