1 Data Type
js data type into basic data types and complex data types
Basic data types
number (numeric type) string (i string type) Boolean (boolean) null (empty) undefined (undefined)
in which the number printed on the console and the true blue
NaN: not a number is not a number (a number type a)
isNaN: judgment is not not a number, if not the figure was true, that figure was false
Complex data types
Object Array Functions
Conversion between the two data types
Number () are converted to digital if not a number returns NaN
parseInt () to an integer if the first one is not a number returns NaN
parseFloat () converted into a floating-point number if the first one is not a number returns NaN
Boolean () converted into Boolean type
toString () into a string
3 detects the data type
1 typeof basic data types may be detected, but encountered complex data types not work
when the object is an array detector
detecting a null object
2 Object.prototype.toString.call () can detect all types of data
Calculation between data types 4
(1) between the string and the sum of all elementary data types are string
(2) when added will convert between true boolean type number to 1, false converted to 0
when the addition result is undefined NaN3
(. 3 ) when the boolean type addition result is undefined NaN
(. 4) in addition to undefined string concatenation string adding the rest are always NaN
when subtraction between data types
when the number string and subtraction, if there is a pure string numbers, then the result is a number of digital type, if there is not a pure numeric string, the result is NaN.
when the subtraction is also undefined NaN.
first string is determined when the string inside the other types is not purely digital subtraction, If the result is not a pure digital pure digital NaN if, in addition to undefined subtraction is NaN, the rest of all types of digital number