NULL is an object that represents "none", and a value of 0;undefined is a primitive value that represents "none", and a value of Nan when converted to a number. when the declared variable has not been initialized, the default value for the variable is undefined. Null is used to represent an object that does not already exist, and is commonly used to indicate that a function is attempting to return a nonexistent object. undefined means "missing value", that is, there should be a value here, but there is no definition. The typical usage is:(1) The variable is declared, but when it is not assigned, it is equal to undefined. (2) when calling a function, the argument that should be supplied is not provided, which equals undefined. (3) The object does not have an assigned property, and the value of this property is undefined. (4) When the function does not return a value, undefined is returned by default. null means "No object", that is, there should be no value at all. Typical usage is:(1) as a function parameter, the parameter of the function is not an object. (2) As the end point of the object prototype chain.
Null and Undefine