Hacker News new | ask | show | jobs
by XorNot 762 days ago
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.

1 comments

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.