Null means no value, and undefined represents an undeclared variable, or a variable that has been declared but not assigned a value, or an object property that does not exist.
The NaN property is a special value that represents a non-numeric value. This property is used to indicate that a value is not a number. You can set the number object to this value to indicate that it is not a numeric value.
Null:
Indicates that there is no value, but that null itself is an object in the console execution typeof null result is an object
1 var ob={}; 2 console.log (OB)
The result is: Object {}
var ob; typeof Ob;
Or:
var ob=null; typeof Ob;
The result is: Object
Nan
Some arithmetic operations, such as the square root of a negative number, are not numbers. Methods parseint () and parsefloat () return this value when the specified string cannot be resolved. For some functions that return a valid number in general, you can also use this method to illustrate the error condition with Number.NaN
Such as:
MATH.SQRT (-1);
The result is: NAN
var Num=1; Num. Nan;console.log (num);
The result of the execution is:
Undefined
But execution isNaN (1) results to False (isNaN's execution result is always Boolean)
Undefined
Undefined corresponds to type undefined, Boolean false, string undefined, numeric calculation result must be Nan
1+undefined;
Execution result is: NAN
Nan undefined and null in JavaScript