Wales wrote:So why not just do == instead of ===? Is there a difference?
Yes, as I said in fewer words above, "===" only evaluates as true if both expressions are equal and of the same type, whereas "==" evaluates as true even if the expressions are different types, as long as they evaluate to the same value when cast to the same type. Therefore:
(false == false) // true
(false == 0) // true
(false == "") // true
(false == null) // true
// but...
(false === false) // true
(false === 0) // false
(false === "") // false
(false === null) // false