Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

I get an error message even though my input is outputting correctly. What did I do wrong in the end, please, someone! LOL
// running tests
6. With 2000 as the value of the year variable, the result should be 2000 is a leap year..
// tests completed
// console output
2000 is a leap hear.

Your code so far

function isLeapYear (year) {
if(year % 400 === 0) {
  return `${year} is a leap hear.`;

}else if(year % 100 === 0) {
  return `${year} is not a leap year.`;

  }else if(year % 4 === 0) {
    return `${year} is a leap year.`;
    
     }else{
       return `${year} is not a leap year`;
     }
}
let year = 2000;
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/136.0.0.0 Safari/537.36 Edg/136.0.0.0

Challenge Information:

Build a Leap Year Calculator - Build a Leap Year Calculator

Read this line very carefully.

OMG! Thank you! Jeremy! You’re a genius. I didn’t see it. Read it too many times!

1 Like