Arjun Mehta2 months agoMost voted11
![] gets evaluated first. arrays are truthy (even empty ones) so ![] = false.
now you have [] == false. with == both sides get converted to numbers:
false -> 0
[] -> "" -> 0
0 == 0 so true.
this is why everyone uses === , it doesn't do any of this conversion