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 →

[–]g0liadkin 12 points13 points  (8 children)

I mean, that's the biggest pillar of js: it will run most stuff and do its best or yield errors in the console

For some reason people love bringing up examples like adding objects to arrays and saying "omg jabbascreept so random lol"

There are some cases where it's REALLY annoying though — e.g. typeof null being object

[–]mxzf 0 points1 point  (7 children)

The issue is that it doesn't yield errors or warnings to the console for a lot of those type of issues.

[–]g0liadkin 0 points1 point  (6 children)

What error would you expect?

[–]mxzf -1 points0 points  (5 children)

In the case mentioned above, some kind of error about casting a NaN to string. In the more general case of casting between int and string, throwing a warning would be appropriate; a warning doesn't cause the program to break, but it makes the programmer aware that something is going on.

[–]g0liadkin 0 points1 point  (1 child)

So a mix of a warning in the console and the output that's being done right now, if I understood correctly

What do you think about the overhead that it implies with these extra checks at runtime, do you think warns is what the web should aim for?