Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*If the year is divisible by 4 and not divisible by 100 unless the number is divisible by 400, the year is a leap year.*/
- function isLeapYear(year){
- if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0){
- console.log(year + ' is a leap year.')
- } else {
- console.log(year + ' is not a leap year.')
- }
- }
- isLeapYear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement