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)

Collapse
hanpari profile image
Pavel Morava

Is not cricket?

I had to google this one. It made me laugh when I learned what it means.

Frankly, it was a quick idea, surprisingly hard to code, given Javascript odd standard library.