Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

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

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

Hey @noah5

I went through the lab file and found that test #2 is only accepting following function definition

function isLeapYear(year) {

}

It is supposed to accept both definitions, but for some reason it is not. I’ll create an issue on this and hopefully, it will be fixed.

Have a nice day!

Issue has been fixed! soon it will be deployed to production.