Tell us what’s happening:
I don’t understand why or what the scenario asked. I’m creating code for Test 5 and it passed, but when I adding another code to cover Test 6 it passed on Test 6 but failed on Test 5.
Your code so far
function isLeapYear(num){
if (num % 4 == 0){
if(num % 400 == 0){
return `${year} is a leap year.`;
}
if(num % 100 == 0){
return `${year} is not a leap year.`;
}
return `${year} is a leap year.`;
} else {
return `${year} is not a leap year.`;
}
}
let year = 2024;
let 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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Challenge Information:
Build a Leap Year Calculator - Build a Leap Year Calculator