Skip to content

Commit 1236e2f

Browse files
committed
Added in a if for Number.isNaN to check if for word or symbol input instead of a number value or the J Q K A
1 parent 23c6ee7 commit 1236e2f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export function getCardValue(card) {
3939
return 10;
4040
} else if (cardNumber === "A") {
4141
return 11;
42+
} else if (Number.isNaN(value)) {
43+
throw new Error("Incorrect card number given");
4244
} else if (value >= 2 && value <= 10) {
4345
return value;
4446
} else if (value < 2 || value > 10) {

0 commit comments

Comments
 (0)