Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

  1. With 2024 as the value of the year variable, the result should be 2024 is a leap year..
    Failed:6. With 2000 as the value of the year variable, the result should be 2000 is a leap year..
    Failed:7. With 1900 as the value of the year variable, the result should be 1900 is not a leap year..

can see results are ok to me but still these above points not passing.

Your code so far

function isLeapYear(year) 
{
if (year%4==0 && year%400==0 || year%100!=0 &&year%4==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/144.0.0.0 Safari/537.36 Edg/144.0.0.0

Challenge Information:

Build a Leap Year Calculator - Build a Leap Year Calculator

You have simply two typos in the end of the returned values.

Seems like an accident. Have you wrote the syntax first and than added the backsticks?

not sure what u saying sorry, I tried to add those sticks again but still same.

Sorry for misleading you with my question.

You just have to make sure the are dots . at the end of the sentences.
Tests are looking for 100% string match.

1 Like

aaa got it never thought of that tiny mistake. Its gone thru. Many Thanks:)

1 Like