Skip to content

Commit a9c0735

Browse files
authored
Add error handling for invalid card values
Throw an error for invalid card strings.
1 parent f718131 commit a9c0735

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ function getCardValue(card) {
4343
return numericValue;
4444
}
4545

46+
throw new Error("Invalid card string");
47+
48+
4649
}
4750

4851
// The line below allows us to load the getCardValue function into tests in other files.

0 commit comments

Comments
 (0)