Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

Can someone help with test ten it says I should store the result of calling the function in a variable called result. Thank you
let year = “”;

function isLeapYear(year) {
if (year % 400 === 0) {
return ${year} is a leap year.;
}
else if (year % 100 === 0) {
return ${year} is not a leap year.;
}
else if (year % 4 === 0) {
return ${year} is a leap year.;
}
else {
return ${year} is not a leap year.;
}
}
const result = isLeapYear();
console.log(result);

Your code so far

let year = "";

function isLeapYear(year) {
  if (year % 400 === 0) {
    return `${year} is a leap year.`;
  }
  else if (year % 100 === 0) {
    return `${year} is not a leap year.`;
  }
  else if (year % 4 === 0) {
    return `${year} is a leap year.`;
  }
  else {
    return `${year} is not a leap year.`;
  }
}

const result = isLeapYear();
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
https://www.freecodecamp.org/learn/full-stack-developer/lab-leap-year-calculator/build-a-leap-year-calculator

Hi @A.M.Mutiso and welcome to our community!

Note these two User Stories:

Outside the function, declare a variable year that stores the value of the year you want to check.

You should call the isLeapYear function with year as the argument and assign the result to a variable named result.

You have declared a year variable but you haven’t assigned a suitable value to it.
You have called the isLeapYear function but you haven’t supplied an argument to it.

Look at what you’re initializing to the const result variable, it’s isLeapYear(), right?
Then look at your function isLeapYear(year) again, what’s missing?