14 lines
No EOL
284 B
TypeScript
14 lines
No EOL
284 B
TypeScript
function isLeapYear(year: number): boolean {
|
|
if (year % 4 == 0) {
|
|
if (year % 100 == 0) {
|
|
if (year % 400 == 0) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
export default isLeapYear |