Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

I am failing task 9.
“You should store the result of calling the isLeapYear function in a variable named result”
I saw another post saying to declare the result variable with const instead of let, but that did not wok me.

Your code so far

let year = 0;

function isLeapYear(year){
  if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)){
    return year + " is a leap year.";
  }

  else return year + " is not a leap year.";  
  
}

let result = isLeapYear(2024);
console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:144.0) Gecko/20100101 Firefox/144.0

Challenge Information:

Build a Leap Year Calculator - Build a Leap Year Calculator

Welcome to the forum @gavinmossbusiness

Try calling the function with the variable you declared in line 1.

Happy coding

1 Like