Skip to content

Function: isLeapYear()

ts
function isLeapYear(yearOrDate): boolean;

Check if the given year or the year of the given date is a leap year. 检查给定年份(或 Date 的年份)是否为闰年。

Parameters

ParameterType
yearOrDatenumber | Date

Returns

boolean

Example

ts
isLeapYear(2024) // => true
isLeapYear(2023) // => false

Since

1.0.0

Released under the MIT License.