const year = 2024;
function isLeapYear(year) {
if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {
return `${year} is a leap year`;
} else {
return `${year} is not a leap year`;
}
}
const result = isLeapYear(year);
console.log(result);
I try to execute it, but keeps telling me:
// running tests
5. With 2024 as the value of the year variable, the result should be 2024 is a leap year.
6. With 2000 as the value of the year variable, the result should be 2000 is a leap year.
7. With 1900 as the value of the year variable, the result should be 1900 is not a leap year.
// tests completed
// console output
2024 is a leap year
I tried with 2024, 2000, and 1900 and I get the proper result, but still doesn’t pass.
Thanks for your time.