Leap
This commit is contained in:
6
typescript/leap/leap.ts
Normal file
6
typescript/leap/leap.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function isLeap(year: number): boolean {
|
||||
if (year % 400 === 0) return true;
|
||||
if (year % 100 === 0) return false;
|
||||
if (year % 4 === 0) return true;
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user