Skip to content

Commit 4eb7cd7

Browse files
committed
refactored: removed redundant code
1 parent a8c0c3b commit 4eb7cd7

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ function getCardValue(card) {
2626
if (card === "") {
2727
throw new Error("No card was played");
2828
}
29-
if (card.length < 2 || card.length > 3) {
30-
throw new Error(
31-
"Invalid card played, rank and suit cannot be less than 1 or more than 3"
32-
);
33-
}
29+
3430
const rank = card.slice(0, -1).toUpperCase();
3531
const suit = card.slice(-1);
3632

0 commit comments

Comments
 (0)