mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
20 lines
371 B
JavaScript
20 lines
371 B
JavaScript
const leapYears = function(year) {
|
|
if (year%4 === 0 ) {
|
|
if (year % 100 === 0) {
|
|
if (year % 400 === 0) {
|
|
return true;
|
|
}
|
|
else {
|
|
return false
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
else {
|
|
return false
|
|
}
|
|
};
|
|
|
|
// Do not edit below this line
|
|
module.exports = leapYears;
|