Skip to content

Commit 9ab2716

Browse files
committed
fixed the indentation in the function
1 parent 22cbee3 commit 9ab2716

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@ 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") {
43+
return 11;
44+
}
45+
46+
if (["J", "Q", "K"].includes(rank)) {
47+
return 10;
48+
}
49+
50+
return parseInt(rank);
4551
}
4652

4753
// The line below allows us to load the getCardValue function into tests in other files.
@@ -77,5 +83,4 @@ try {
7783
7884
try { getCardValue("9X"); // Invalid suit
7985
console.error("Error was not thrown for invalid suit");
80-
} catch (e) {}
81-
*/
86+
} catch (e) {} */

0 commit comments

Comments
 (0)