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.
And that doesn't happen in many decent languages. That is, languages with strong typing.