An if statement that check if leapYear is divisible by 4 will equal 0

and also check if leapYear divisible by 100 will not equal 0
and compare also if leapYear is divisible by 400 and will equal 0
This commit is contained in:
Isah Jacob 2022-10-30 23:46:42 +01:00
parent c06c96ab14
commit 34e89ed634
1 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,11 @@
const leapYears = function() {
const leapYears = function(leapYear) {
return leapYear % 4 === 0 && (leapYear % 100 !== 0 || leapYear % 400 == 0)
};
leapYears(1996)
leapYears(1997)
leapYears(34992)
leapYears(1900)
leapYears(1600)
leapYears(700)
// Do not edit below this line
module.exports = leapYears;