Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

I’m quite stumped here as to what to do, i can’t get stepts 5,6 and 7 to clear no matter what I try. What is wrong with my code?

Your code so far


let year = 1900;
function isLeapYear(year) {
if (year % 4 === 0) {
  return "[isLeapYear] is a leap year."
}
else {
  return "[isLeapYear] is not a leap year." 

}
} 
const 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/150.0.0.0 Safari/537.36 OPR/134.0.0.0 (Edition std-1)

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

Hi @P3dr0,

A leap year is a year that is divisible by 4, except for years that are divisible by 100 and not divisible by 400.

Does your algorithm reflect what the instructions say determines a leap year?

Are you using the function parameter in your return message? (Brackets in the instruction are just there to indicate a variable; they are not intended to be literal)

Happy coding