It seems that I have seen null==undefined and null!==undefined before, but I never paid attention to them.
Recently I was looking at someone else’s program source code, and there were some judgments like if(x!=undefined&&x!=null&&x!="") everywhere. I suddenly felt that the writing was very verbose. I am usually direct. if(x){}because null, undefined, "" are actually false in conditional judgment, why is it so verbose? (However, please note that if your x==0 is also a legal value, you cannot use if(x){} to make conditional judgments)
In order to prove this redundancy, I also specially did the following test:
var a;
alert(x)
if(x==null){
alert('failed')
}
where x is an uninitialized Variable, that is, undefined.
Run the above code: undefined and failed pop up successively, indicating that x==null is qualified.
We can directly alert(null==undefined) and actually find that true is returned.
This all shows that writing such as x==null||x==undefined or x!=null&&x!=undefined is completely redundant!
Generally, you only need to judge null or undefined.