Evaluating the following statements in a browser's javascript console yields the results shown:
"0" == 0 // true
"0" == false // true
"0" == true // false
0 ? true : false // false
"0" ? true : false // true ???? WHAT ???
The first four make sense but not the last one. Is this a bug? If not, how is the "0" being typecast in order to make it appear truthy, but why does this only happen for the ternary operator and not equality operator?
(Tested in multiple browser consoles with same result.)