Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

bro how to reusable the function more other times, because when I written this code

I wanna to use another time function like
let year = 2000;
let result = isLeapYear(year)
;

let year = 1900;
let result = isLeapYear(year)
;

Your code so far

function isLeapYear(year){

  if(year %4===0 && year %100!==0 || year %4===0 && year %400===0){
    return `${year} is a leep year.`
  }else{
    return `${year} is not a leep 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/138.0.0.0 Safari/537.36

Challenge Information:

Build a Leap Year Calculator - Build a Leap Year Calculator


I saw error number 5, 6 and 7.

It seems you’re doing that correctly. Is this the output you get?

2024 is a leep year.
2000 is a leep year.
1900 is not a leep year.

Is that not what you wanted?

Leap is mis-spelled.


yeas it’s seems correctly, but why look number 5, 6,7 when I clicked submit answer does not going anywhere

did you fix the spelling mistake?