@dctewi Lulz
made with 1 line (in C)
if(number %2){return true;}else{return false;}

@dctewi I'm pretty sure 80% of npm is hipsters coding ironically.

function isOdd(i) {
return i > 0&& isEven(i - 1) || i < 0 && isOdd(i + 2);

@dctewi Here's the effective source (MIT license please don't steal):

Unfortunately, it's about 100 characters too long to fit in a toot (at the default 500 maximum length)

@dctewi Okay, their tests (discounting error messages) pass with this implementation:

function isOdd(num) {
return (Math.abs(num) % 2) == 1

@dctewi this thing is downloaded 4 million times a month. Twice every second.


Sign in to participate in the conversation

Welcome to your niu world ! We are a cute and loving international community O(≧▽≦)O !
We are a moderated instance, that aren't supporting harassment nor hateful speech. But we aren't a "safe" space, we won't prevent you to interact with instances that aren't respecting our rules.
"Be conservative in what you send and liberal in what you receive." - Netiquette
The main language used here is English, but for most of us this isn't our main language, so it's a great place to learn!