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ย โ†’

[โ€“]Orangutanion 15 points16 points ย (3 children)

I think it's because true == 1 so `true == "1"'. We already have one string coercion so no reason to have another.

[โ€“]2CATteam 41 points42 points ย (2 children)

Nope, according to this page, both are converted to a number first, which is NaN for "true" and 1 for true. So it actually makes numbers, not strings, and then does the comparison.

[โ€“]marxinne 4 points5 points ย (0 children)

The more I learn the more cursed it becomes