Skip to content

Instantly share code, notes, and snippets.

@abonello
Forked from ls404/LeapYear.js
Created June 16, 2018 06:01
Show Gist options
  • Save abonello/59f8c1adc39ef354186bb142d7dedf46 to your computer and use it in GitHub Desktop.
Save abonello/59f8c1adc39ef354186bb142d7dedf46 to your computer and use it in GitHub Desktop.
Leap year finder
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