It seems that I have also seen null = undefined, null! = Undefined.
One of the pastProgramSource code, such as if (X! = Undefined & X! = NULL & X! = "") And so on, suddenly felt that the write is very wordy, I usually directly if (X) {} No matter whether it is null, undefined, or "", it is true that it is false in the condition judgment. Why should it be so arrogant? (However, if your X = 0 is also a valid value, you cannot use if (x) {} for condition determination)
To prove this redundancy, I also made the following tests:
VaR;
Alert (X)
If (x = NULL ){
Alert ('failed ')
}
X is an uninitialized variable, that is, undefined.
RunCode: Undefined and failed are successively displayed, indicating that X = NULL is qualified.
We can directly use alert (null = undefined) to find that true is returned.
This indicates that X = NULL | x = undefined or X! = NULL & X! = Undefined is redundant!
Generally, you only need to judge null or undefined.