Last active
February 2, 2017 15:10
-
-
Save dhunmoon/ebfbf4e9130dff1134d57c8196cbf361 to your computer and use it in GitHub Desktop.
JS: Check Leap Year
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
if(month == 2){//Means if it is month of feborary | |
if(nyear %4 == 0 && ( nyear %400 != 0 || nyear %100 !== 0 ){//Leap year statement | |
return true | |
} | |
}else{ | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment