/javascript/leap/leap.js

1
2
3
4
5
6
7
8
9
10
11
function isLeapYear(year) {
	if (year % 400 === 0) {
		return true;
	} else if (year % 100 === 0) {
		return false;
	} else {
		return year % 4 === 0;
	}
}

module.exports = isLeapYear;

Comments


You're not logged in right now. Please login via GitHub to comment