-
-
Save abonello/59f8c1adc39ef354186bb142d7dedf46 to your computer and use it in GitHub Desktop.
Leap year finder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isLeap(x) { | |
let leap = (x % 4 == 0 && x % 100 != 0) || x % 400 == 0; | |
console.log(leap ? "yes" : "no"); | |
} | |
isLeap(['2016']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment