Hello,
I tryed to find the solution to the leap-year exercise. All I get correct is 5/9. The easy one with : return !isleap
//
// This is only a SKELETON file for the 'Leap' exercise. It's been provided as a
// convenience to get you started writing code faster.
//
export const isLeap = () => {
if (isLeap % 4 == 0){ return isLeap; }
else if (isLeap % 400 == 0 && isLeap % 100 == 0){ return isLeap; }
//if (isLeap % 100 == 0){ return isLeap; }
else{
return !isLeap;}
}
Well, I think yes. isleap = 1996
then I check if the rest of the division with 4 is equal to 0
if it is the case I return true with isleap.
Is this ok ?
Oh. My bad. I think the issue is actually that your function isn’t actually returning true like it’s supposed to. Where does your code ever return true?