passed all tests

This commit is contained in:
Fredrik Uddenfeldt 2023-05-21 22:33:26 +02:00
parent 12e58788cd
commit 15d07a232b
1 changed files with 7 additions and 2 deletions
06_leapYears

View File

@ -1,7 +1,12 @@
const leapYears = function(year) {
if (year % 4 == 0) {return true}
if (year % 4 != 0) {return false}
if (
year % 4 == 0
&& year % 100 != 0
|| year % 400 == 0
)
return true
else return false
};
// Do not edit below this line