Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

Im getting the right responses but its telling me I need to check test section 5 and 6

Your code so far

let year = 1900;

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

Challenge Information:

Build a Leap Year Calculator - Build a Leap Year Calculator

I feel like this is missing a set of () to correctly group the logic

I tried that first and then seen it still worked after I removed them but the results were the same.

It makes a difference. Where did you try including the ()s

Also, note that your function needs to use its arguments and not global variables.

1 Like

You sir are the man!!! That was it!

1 Like

you have num here, but you also use year inside the function, are you sure that will do what you want?