The loose equality spec has a special rule: null == undefined is true, but null and undefined are not equal to any other value, and crucially they are NOT coerced to numbers in == comparisons. So null == 0 and undefined == 0 are both false, even though Number(null) is 0. This is why == with null only matches null or undefined.