Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

My code works for all the year values, but I am still unmarked for 5,6 and 7. Can anyone please help me out?

Your code so far

let year = 1997;

function isLeapYear(input){
  if(input % 4 === 0 && input % 100 !==0){
    return year + " is a leap year";
  }else if(input % 4 === 0 && input % 400 === 0){
    return year + " is a leap year";
  }else return year + " 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/144.0.0.0 Safari/537.36

Challenge Information:

Build a Leap Year Calculator - Build a Leap Year Calculator

Are there any errors or messages in the console?

What is the requirement of test 5? (focus on one test at a time)

Have you tried testing with those years?

Make sure to use your parameters in your function.

What would happen if I tested your function like this?

console.log(isLeapYear(2005));

Also, please carefully check the messages you are returning. Do they match the instructions exactly?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.