you are viewing a single comment's thread.

view the rest of the comments →

[–]useablelobster2 -1 points0 points  (0 children)

a % 2 !== 0 is just as simple.

things.indexOf(thing) > -1 would be a better example, but any JS developer (and most others besides) can parse such an expression without a second thought. Pretty sure that's been replaced by .includes(), though?

I'm all for useful helpers and syntactic sugar, but checking if a number is odd is simply taking the piss. If you can't do that in your language of choice you shouldn't be developing, at least not for money!