CodeThere is only one type of function. 
 
Undefined: Undefined. We can also call it nonexistent. typeof (undefined) = undefined.
 
Null: null. Undefined does not exist, but null does. Typeof (null) = object, but null is not an object. This is the magic and uniqueness of null.
 
Boolean: true or false.
 
Number: Nan and infinity are two special numbers. Nan represents a number that cannot be expressed by a number, while Infinity represents an infinite number, and-infinify represents negative infinity. There are two special points here: Nan! = Nan, infinity/infinity = Nan. In the number type, there is a very useful method: tostring (), he can accept a number from 2 to 36, and then convert our number to the corresponding hexadecimal number.
 
String: string, which is the smallest unit of text in JavaScript. In a string, there are two such functions: charat (INDEX) and charcodeat (INDEX), which respectively return the character and character unicode encoding of the corresponding index. In normal times, we may often use the following access method, such as S [10]. However, this is not the ecmascript standard and should be avoided as much as possible.
 
All types of JavaScript are built up based on these five simple types. There are thousands of complex relationships between these five types. When undefined, null, 0, "" is converted to boolean, it is false. All except these four types are true. However, among the five, except for undefined = NULL, none of them are equal.
 
We have such a strong type of language, such as 123 = "123 ". How can we differentiate data types? In this case, all equal: = is used.