samuelmarina / is-odd

Is a number odd?
172 stars 22 forks source link

It's this simple: #28

Open Reper2 opened 1 year ago

Reper2 commented 1 year ago

function isOdd(n) { n % 2 != 0 ? console.log("Number is odd.") : console.log("Number is even."); }

isOdd(1) // "Number is odd." isOdd(2) // "Number is even."

oshalabydev commented 1 year ago

I don't know if this is all a sick joke at that point.

qleveque commented 1 week ago

I tried your function, but !isOdd(3) returns true, and it should definitely be false. is-odd looks much more robust.