I'd say the problem is that strict equality can be well defined for different types (unequal types are strictly unequal), but relational operators can not be well defined for different types.
Assume we define a strict comparator a <== b to be typeof a == typeof b && a <= b. We also define a strict comparator a >== b to be typeof a == typeof b && a >= b.
If we set a = "3" and b = 3 , the results are a <== b false, a >== b false and a === b false.
Such strict comparator would mess things up like sorting algorithms or comparing unexpected values. For example:
for (var i; i <== list.count; i++) {
doStuff(i);
}
Note that the example mistakenly uses list.count instead of list.length, which will just return undefined. The for loop conditional will just return false when i <== undefined is evaluated, so the for loop will be entirely skipped to the surprise of the programmer.
It would be much better if JavaScript was designed to raise an error if the type comparison were to fail with a strict comparator. For that matter it would be amazing if an error like Undefined Property were to be raised if an invalid property is accessed like list.count.
That's all I can say on this matter. Comparing across types should raise an exception, just like any other decent language out there. But it doesn't.
This means that the practical solution is to start using preprocessors like TypeScript. Or just say "Oh well" and keep typing JavaScript.