Tell us what’s happening:
The code won’t even pass the first test “you should define a function named isLeapYear”, am I missing something here?
Your code so far
function isLeapYear(year){
if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0 && year % 100 !== 0){
return `${year} is a leap year.`;
}
else{
return `${year} is not a leap year.`;
}
}
let year = 2024;
result = isLeapYear(year);
console.log(result);
year = 2000;
result = isLeapYear(year);
console.log(result);
year = 1900;
result = isLeapYear(year);
console.log(result);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0
Challenge Information:
Build a Leap Year Calculator - Build a Leap Year Calculator