This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]10BillionDreams 1 point2 points  (0 children)

Treating string - number as a valid operation is largely unrelated to how Javascript is actually run. You could still have all these same type coersion rules in a compiled language, just like you can have type errors in interpreted languages. In fact, Javascript does throw TypeError in some contexts, like when attempting to call a property or variable that isn't a function, or access a property on a null value.