3 ms·
That's wrong. What's about this Python code: 1.0 + 1 Or this Scala Code: "1".toFloat + "1".toInt In both cases that's clearly implicit type coercion at
by still_grokking 8y ago
That's wrong.
What's about this Python code:
1.0 + 1
Or this Scala Code:
"1".toFloat + "1".toInt
In both cases that's clearly implicit type coercion at runtime.
So according to the above constraint there would hardly be any strongly typed languages… (But quite the opposite is true in fact).
Weakly typed means you can hose the type-system somehow and then perform some "illegal" or completely nonsensical operation. For example that's easy in C, but not possible in JS. In a strongly typed language any value has some precise type at any time. This is true for JS so it's strongly typed.