Created
March 9, 2018 14:28
-
-
Save ls404/0d13c1eb32a1001d29078af5d13ceb37 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