diff --git a/README.md b/README.md new file mode 100644 index 0000000..1a1faaa --- /dev/null +++ b/README.md @@ -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. + diff --git a/leap-year.js b/leap-year.js new file mode 100644 index 0000000..11900d2 --- /dev/null +++ b/leap-year.js @@ -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) +}