Failing: The isLeapYear function should take a number as an argument
Your code so far
let isLeapYear = function (year) {
if (year % 4 === 0) {
if (year % 100 === 0 && year % 400 !== 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);
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Challenge Information:
Build a Leap Year Calculator - Build a Leap Year Calculator