Skip to content

Commit 7d02b97

Browse files
Simplify numeric rank validation logic
Removed redundant check for string equality in numeric rank validation.
1 parent 147afcc commit 7d02b97

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getCardValue(card) {
3131

3232
// Parse numeric ranks ("2" through "10")
3333
const numericValue = parseInt(rank, 10);
34-
if (!isNaN(numericValue) && numericValue >= 2 && numericValue <= 10 && String(numericValue) === rank) {
34+
if (!isNaN(numericValue) && numericValue >= 2 && numericValue <= 10) {
3535
return numericValue;
3636
}
3737

@@ -93,4 +93,4 @@ assertThrows("A♣️"); // Suit variations or hidden characters
9393
assertThrows("Q⭐️"); // Invalid suit emoji
9494
assertThrows("J ♠"); // Unwanted spacing
9595

96-
console.log("All tests completed!");
96+
console.log("All tests completed!");

0 commit comments

Comments
 (0)