Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

I’m confused it works, but not according to the checker…

Your code so far

function isLeapYear (number) {
  if (number % 4 == 0 && number % 100 !== 0 || number % 400 == 0)
  {
    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 (Windows NT 10.0; Win64; x64) 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

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/lab-leap-year-calculator/66c06fad3475cd92421b9ac2.md at main · freeCodeCamp/freeCodeCamp · GitHub

if the function parameter is number, what is year?

Thank you, I’m stupid :wink: