Completed sixth exercise

This commit is contained in:
octopusGarden 2022-10-25 13:36:36 -04:00
parent 8800dd93ae
commit 06b0bc8a26
1 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,14 @@
const leapYears = function() { const leapYears = function(year) {
//if year is divisible by 100 && 400
//if year is divisible by 4
//else false
if (year % 100 === 0 && year % 400 === 0) {
return true;
} else if (year % 4 === 0) {
return true;
} else {
return false;
}
}; };
// Do not edit below this line // Do not edit below this line