We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6db1bca commit 8f61c0fCopy full SHA for 8f61c0f
Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js
@@ -15,10 +15,10 @@ function getCardValue(card) {
15
return 11;
16
}
17
18
- const numValue = parseInt(rank, 10);
19
- if (numValue >= 2 && numValue <= 10) {
20
- return numValue;
21
- }
+const numeric = Number(rank);
+if (Number.isInteger(numeric) && numeric >= 2 && numeric <= 10) {
+ return numeric;
+}
22
23
if (rank === "J" || rank === "Q" || rank === "K") {
24
return 10;
0 commit comments