Last active
December 20, 2015 21:59
-
-
Save ianpgall/6201642 to your computer and use it in GitHub Desktop.
JavaScript function that determines if a specific year is a leap year
This file contains hidden or 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
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