3 Answers
+ 6
Reasons:
First of all, == operator checks if "values" are equal or not!
1. (0 == "0")
As 0(int) is equal to 0(string). Hence evaluates to true!
2. (0 == [ ])
here 0 has no value i.e., it behaves as false value and so is the [ ] array. Hence alerts true!
3. ("0" == [ ]) - most interesting ;)
"0" is defined i.e., it has a true value, whereas as above mentioned [ ] acts as a false value. So, the whole statement evaluates to false!
Hope you understood :)
+ 2
(0 === "0"); //FALSE
=== compare also type, an INT is not a STRING
+ 2
== doesnt look to the type so 0 and "0" are equal but === looks to the type and 0==="0" is not true(falseđ) if you want to know if something has the same type and value use ===