You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 14, 2024. It is now read-only.
In this project you'll write a script that validates whether or not a credit card number is valid.
4
5
@@ -11,26 +12,22 @@ Here are the rules for a valid number:
11
12
12
13
For example, the following credit card numbers are valid:
13
14
14
-
```markdown
15
-
9999777788880000
16
-
6666666666661666
17
-
```
15
+
- 9999777788880000
16
+
- 6666666666661666
18
17
19
18
And the following credit card numbers are invalid:
20
19
21
-
```markdown
22
-
a92332119c011112 (invalid characters)
23
-
4444444444444444 (only one type of number)
24
-
1111111111111110 (sum less than 16)
25
-
6666666666666661 (odd final number)
26
-
```
20
+
- a92332119c011112 (invalid characters)
21
+
- 4444444444444444 (only one type of number)
22
+
- 1111111111111110 (sum less than 16)
23
+
- 6666666666666661 (odd final number)
27
24
28
25
These are the requirements your project needs to fulfill:
29
26
30
-
- Make a JavaScript file with a name that describes its contents.
31
27
- Create a function with a descriptive name which makes it clear what the function does. The function should take one argument, the credit card number to validate.
32
28
- Write at least 2 comments that explain to others what a line of code is meant to do.
33
29
- Return a boolean from the function to indicate whether the credit card number is valid.
34
-
- Use `node` from the command line to test if your code works as expected.
30
+
- Use `node extra/1-card-validator.js` from the command line to test if your code works as expected.
0 commit comments