File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
exercises/practice/leap/.approaches/match-on-a-tuple Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ A [tuple][tuple] is made from the conditions for the year being evenly divisible
22
22
This is similar to ` default ` used in ` switch ` statements in other languages.
23
23
It returns ` false ` no matter what the values in the tuple are.
24
24
25
- | year | year % 4 | year % 100 | year % 400 == 0 | is leap year |
25
+ | year | year % 4 | year % 100 | year % 400 | is leap year |
26
26
| ---- | -------- | ---------- | --------------- | ------------ |
27
27
| 2020 | 0 | 20 | 20 | true |
28
28
| 2019 | 3 | 19 | 19 | false |
29
- | 2020 | 0 | 0 | 0 | true |
29
+ | 2000 | 0 | 0 | 0 | true |
30
30
| 1900 | 0 | 0 | 300 | false |
31
31
32
32
Although some may consider it to be a more "functional" approach, the ` switch ` on a ` tuple ` approach is somewhat more verbose than other approaches,
You can’t perform that action at this time.
0 commit comments