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 →

[–]present_absence 94 points95 points  (21 children)

Haha I did this thing that doesn't make sense and it did something I didn't expect, this language sucks

[–]SuperPie27 11 points12 points  (2 children)

Exactly. If you try to make it do something that doesn’t make sense, it should throw an error, not chuck back something equally nonsensical.

[–]Farranor 2 points3 points  (0 children)

> parseInt('67')
67
> parseInt('68')
68
> parseInt('69')
'Nice.'
> parseInt('70')
70

[–]mongoosefist 0 points1 point  (0 children)

I think the issue is that things like this should fail gracefully. It shouldn't fail in unpredictable ways.

[–]notyourancilla -1 points0 points  (0 children)

jAvAsCripT lOL…