As far as I know in JavaScript !! is supposed to normalize a boolean value converting it to true or false from some other type. This would mean that the \"0\" converts to bo
The == operator checks for loose equality, which has nothing to do with truthiness.
Specifically, it will convert to operands to numbers, then compare the numbers.
Strings containing numbers convert to the numbers that they contain; booleans convert to 0 and 1.
Objects are converted by calling valueOf, if defined.
Thus, all of the following are true:
"1" == 1"0" == false"1" == true"2" != true"2" != false({ valueOf:function() { return 2; } }) == 2({ valueOf:function() { return 1; } }) == true