JavaScript WTFs are kind of tired, but this one is new to me and it feels deeper than usual: In JavaScript, `==` is an equality operator, but it is not transitive! false == [0] //=> true [0] == false //=> true [0] == [0] //=>false!!!!! (via https://www.reddit.com/r/javascript/comments/bgv0su/if_either_value_aka_side_in_a_comparison_could_be/elo3mo7/ …)
-
-
Replying to @raganwald
It's actually a coercion operator with post-coercion equality tests.
2 replies 0 retweets 7 likes -
Replying to @slightlylate
Well, even within that definition, this is a WTF. For example, if it always coerced to strings, it would be transitive.
2 replies 0 retweets 0 likes -
-
-
Replying to @raganwald
yes, yes it is. I really want this: https://restrictmode.org/
1 reply 0 retweets 0 likes -
Replying to @slightlylate @raganwald
Might there be an avenue towards this with a typed variant of JS? Assuming runtime type-checks are opt-in, they could also enforce those checks.
1 reply 0 retweets 0 likes
Replying to @justinfagnani @raganwald
"==" is so hosed it's going to require a new mode, sadly
11:20 AM - 24 Apr 2019
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.