JavaScript data type of the undefined and null
typeof
Features
Detection variable type
grammar
typeof variable or typeof (variable)
return value
string type, there may be a string, number, boolean, object, undefined, function
undefined
Only one type undefined value, i.e. special undefined
Explanation
In general, there is no need to explicitly set the variable to a worthy case undefined
null
- A null value indicates a null object pointer
- If you define a variable to hold the object to prepare in the future, it is best to change the amount is initialized to null value and not the other
Explanation
undefined values are derived from the null value, it returns undefined == null result is true