Created
August 22, 2024 06:00
-
-
Save abdihaikal/7fc6d2bb0a3151d529d807461453ab9a to your computer and use it in GitHub Desktop.
Check if the year value 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
export const isLeapYear = (year: number): boolean => { | |
return new Date(year, 1, 29).getMonth() === 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment