Skip to content

Instantly share code, notes, and snippets.

@abdihaikal
Created August 22, 2024 06:00
Show Gist options
  • Save abdihaikal/7fc6d2bb0a3151d529d807461453ab9a to your computer and use it in GitHub Desktop.
Save abdihaikal/7fc6d2bb0a3151d529d807461453ab9a to your computer and use it in GitHub Desktop.
Check if the year value is a "Leap year"
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