Skip to content

Commit 3bb3ca7

Browse files
authored
Correct validation logic in getCardValue function
Fix typos in suit and rank validation checks, and correct error throwing.
1 parent 3be8b88 commit 3bb3ca7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const vaildSuits = [""♠", "♥", "♦", "♣"];
2929
const vailRanks = ["A","2","3","4","5","6","7","8","9","10","J","Q","k"];
3030

3131
if (!vaildSuits.includes) || !validRanks.inculdes(rank){
32-
trow new Error("Invaild card");
32+
throw new Error("Invaild card");
3333
}
3434
if (rank === "A") return 11;
3535
if (rank === "J" || rank === "Q" || rank === "K") return 10;

0 commit comments

Comments
 (0)