Tell us what’s happening:
The only issue I have is that my "const result = isLeapYear(year); comes back as result is not a function. The function works properly, I know this because when I take away “(year)” from the result, I get the correct answers, but once I put it back in, all of the tests fail again.
Your code so far
let year = 0;
function isLeapYear(year) {
if(year % 4 == 0 && year % 400 == 0) {
return `${year} is a leap year.`;
} else if(year % 4 == 0 && year % 100 !== 0) {
return `${year} is a leap year.`;
} else if(year % 4 == 0 && year % 100 == 0) {
return `${year} is not a leap year.`;
} else {
return `${year} is not a leap year`;
}
}
year = 2024
const result = isLeapYear(year);
console.log(result(2000))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Challenge Information:
Build a Leap Year Calculator - Build a Leap Year Calculator