Completed sixth exercise
This commit is contained in:
parent
8800dd93ae
commit
06b0bc8a26
|
@ -1,5 +1,14 @@
|
|||
const leapYears = function() {
|
||||
|
||||
const leapYears = function(year) {
|
||||
//if year is divisible by 100 && 400
|
||||
//if year is divisible by 4
|
||||
//else false
|
||||
if (year % 100 === 0 && year % 400 === 0) {
|
||||
return true;
|
||||
} else if (year % 4 === 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Do not edit below this line
|
||||
|
|
Loading…
Reference in New Issue