Hacker News new | ask | show | jobs
by vkoskiv 762 days ago
Am I missing something here, why is a package even needed needed for this? Can you not evaluate `some_int % 2` in Javascript to check for this directly?
1 comments

Javascripts habit of coercing values when you don't want it too would make this presumably a little suspect?

Even so: I'd much rather in my code have a function doing exactly this, rather then peppering it all through my code anyway.

Sure, but that doesn't justify an external dependency
It seems to be a culture things in the JS world. Packaging just 1 or 2 functions as its own separate package and using large chains of dependancies is just the way they do things. In most other languages, if this function existed, it would either be in the standard library or be a tiny part of a single number manipulating library with 100s of functions.