Lmao Oh JavaScript first you steal time by being an unproductive language and now you help lose money because you’re not an industry grade language smh.
Also, this isn't a javascript problem; this is a problem of trying to be too clever and not understanding implicit conversion, which happens in many languages.
And that doesn't happen in many decent languages. That is, languages with strong typing.