DEV Community

Discussion on: Creating a JavaScript Function to Calculate Whether It's a Leap Year

Collapse
 
craigewert profile image
CREEE

Clever, but too obscure to save 2 lines of code.

Moreover, using date libs is not cricket. If you have those, I presume you can just ask

Date.isLeapYear(year)

(with some syntax or other)