generated from betamore/w5-leap-year
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4b3fdfa
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Leap Year | ||
## Task | ||
|
||
`This task can be found on Exercism` | ||
Given a year, report if it is a leap year. | ||
|
||
The tricky thing here is that a leap year in the Gregorian calendar occurs: | ||
|
||
on every year that is evenly divisible by 4 | ||
except every year that is evenly divisible by 100 | ||
unless the year is also evenly divisible by 400 | ||
|
||
For example, 1997 is not a leap year, but 1996 is. 1900 is not a leap year, but 2000 is. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
isLeapYear(){ | ||
|
||
// Write code here | ||
|
||
} | ||
|
||
|
||
|
||
// DONT CHANGE. THIS IS FOR TESTING | ||
let years = [ 2015, 1970, 1996, 1960, 2100, 1900, 2000, 2400, 1800] | ||
|
||
for (let year of years) { | ||
console.log(isLeapYear(year) | ||
} |