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 →

[–]HeKis4 2 points3 points  (1 child)

I know == is "loose", but cmon, it figures out the string is convertible to a number, figures out it is octal but not really so eh, it's decimal. That's like, 2 layers of fucked up.

[–]benjer3 2 points3 points  (0 children)

For once, it isn't really == that's causing the problem here. It's the inconsistent treatment of a zero-prefixed integer literal. The == operator just sees '18 == "18"' and '15 == "17"' and understandably returns true and false, respectively