a == b // false, because they are different array objects.
In all other examples Javascript interpreter will do type-convert:
!object -> !true -> false -> 0
object -> empty array -> 0
which will lead to comparison 0 == 0, which gives true.
In case if one of the array was not empty, for example var a = [1], then second and third comparison would be converted to 1 == 0, and that will result false.
Login in to like
Login in to comment