Build a Leap Year Calculator - Build a Leap Year Calculator

Tell us what’s happening:

My code outputs perfect results, but somehow it’s not being accepted. Please help.

Your code so far

const isLeapYear = year =>
  (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;

let year = 2000;
let result = isLeapYear(year) ? year + " is a leap year." : year + " is not a leap year.";
console.log(result);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0

Challenge Information:

Build a Leap Year Calculator - Build a Leap Year Calculator

the function is not returning the requested strings, only true or false so it is not doing the requested. See user story 5

1 Like

Thanks. Initially, I thought the function name ‘isLeapYear’ sounded like it should’ve returned a boolean value.