As you can see in this javascript equality table , the transitivity of javascript equality is strange.
I understand most of the results of the table, but I have a question regarding the following comparison:
[] == true // false [] == false // true !![] == true // true !![] == false // false
But also:
if ([]) { // this code will run } if (!![]) { // and of course this too }
Why? Is this another extremely bad part? Do you have a reasonable explanation?
source share