Skip to content

Instantly share code, notes, and snippets.

@ianpgall
Last active December 20, 2015 21:59
Show Gist options
  • Save ianpgall/6201642 to your computer and use it in GitHub Desktop.
Save ianpgall/6201642 to your computer and use it in GitHub Desktop.
JavaScript function that determines if a specific year is a leap year
var IsLeapYear = (function () {
"use strict";
var func;
func = function (year) {
return (year % 400) ? ((year % 100) ? ((year % 4) ? false : true) : false) : true;
};
return func;
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment