Skip to content

Commit 60dd1f1

Browse files
committed
ensure only valid cards return numbers
1 parent 4541230 commit 60dd1f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ function getCardValue(card) {
3939
}
4040

4141
// Compute value
42-
if (rank === "A") return 11;
43-
if (["J","Q","K"].includes(rank)) return 10;
44-
return parseInt(rank);
42+
if (rank === "A") return 11;
43+
if (["J","Q","K"].includes(rank)) return 10;
44+
return parseInt(rank);
4545
}
4646

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

0 commit comments

Comments
 (0)