Skip to content

Commit 453995f

Browse files
committed
Refactor card-validator.js to remove ternary operator
1 parent 87e1247 commit 453995f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Sprint-3/4-stretch/card-validator.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ const validateCard = (card) => {
5252
// Must have more than one type of number
5353
const hasMultipleDistinctDigits = new Set(cardStr.split("")).size > 1;
5454

55-
return has16Digits &&
55+
return (
56+
has16Digits &&
5657
hasMoreThanOneDigit &&
5758
hasEvenFinalDigit &&
5859
hasSumOver15 &&
5960
hasMultipleDistinctDigits
60-
? true
61-
: false;
61+
);
6262
};
6363

6464
console.log(validateCard(9999777788880000)); // true

0 commit comments

Comments
 (0)