Skip to content

Commit 1412a3e

Browse files
committed
just -1 work to slice the card string
1 parent 5449bd6 commit 1412a3e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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
@@ -39,7 +39,7 @@ function getCardValue(card) {
3939
];
4040
const suit = ["♠", "♥", "♦", "♣"];
4141

42-
const cardValue = card.slice(0, -1);
42+
const cardValue = card.slice(-1);
4343
const cardSuit = card[card.length - 1];
4444

4545
if (!rank.includes(cardValue) || !suit.includes(cardSuit)) {

0 commit comments

Comments
 (0)