isLeapYear
Checks if the given year
is a leap year.
- Use
new Date()
, setting the date to February 29th of the givenyear
. - Use
Date.prototype.getMonth()
to check if the month is equal to1
.
Checks if the given year
is a leap year.
new Date()
, setting the date to February 29th of the given year
.Date.prototype.getMonth()
to check if the month is equal to 1
.