undefined === null => false
undefined == null => true
-
I have thought about the reason of
undefined == nulland found out only one case:if(document.getElementById() == null) ....Is there any other reason to make (
undefined === null) == false? -
Is there any other examples of use
===– operation in javascript?
They are not equal so the Strict Equality Comparison Algorithm considers them to be false.
The
===gives the most predictable result. I only use==when I have a specific purpose for type coercion. (See Abstract Equality Comparison Algorithm.)