Tell us what’s happening:
The results work in the console but can’t complete the challenge the challenge.
let year = 1900;
function isLeapYear(num) {
if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {
return ${year} is a leap year.
;
} else {
return ${year} is a not leap year.
}
}
let result = isLeapYear(year);
console.log(result);
Your code so far
let year = 1900;
function isLeapYear(num) {
if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {
return `${year} is a leap year.`;
} else {
return `${year} is a not leap year.`
}
}
let 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/137.0.0.0 Safari/537.36
Challenge Information:
Build a Leap Year Calculator - Build a Leap Year Calculator