Solved LeapYears challenge
This commit is contained in:
parent
42076e7424
commit
750f0bb91d
|
@ -1,5 +1,18 @@
|
||||||
const leapYears = function() {
|
const leapYears = function(year){
|
||||||
|
if (year%4 == 0){
|
||||||
|
if (year % 100 !=0){
|
||||||
|
return "Leap Year"
|
||||||
|
}
|
||||||
|
else if (year%400 == 0){
|
||||||
|
return "Leap Year"
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return "Not a Leap Year"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "Not a Leap Year"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = leapYears
|
module.exports = leapYears
|
||||||
|
|
Loading…
Reference in New Issue