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
| Parameter | Type |
|---|---|
yearOrDate | number | Date |
Returns
boolean
Example
ts
isLeapYear(2024) // => true
isLeapYear(2023) // => falseSince
1.0.0