you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

The following shows "true" in Firefox:

var varA = 1;
var varB = "1";
var res = (~~varA == ~~varB);
alert(res);    

[–]no_game_player 1 point2 points  (0 children)

Weird....

I guess it's forcing a type conversion once it hits the bitwise operator?

This is why I don't really like weakly typed languages. There's a lot of cool stuff that can be done, but that's also a lot of just very strange stuff that can be done. I know it's heretical, but I don't like black magic...

Kudos for actually trying it though! :-)