1.1
numeric type to string
String ()
variable . toString ()
ToString () method
The ToString () method converts a logical value to a string and returns the result.
1.2
string to numeric type
Number ()
★ Numeric Type of string, after conversion to get the number.
★ Non-numeric string, after conversion to get is NaN.
★ Decimal type of string, after conversion to get the original number.
parseint
★ Integer numeric type of string, converted to get an integer number.
★ The string at the beginning of the number, which is the number in front of the conversion.
★ A string that starts with a non-digit, and the conversion is NaN.
★ Decimal type of string, converted after rounding.
parsefloat
★ Integer numeric type of string, converted to get an integer number.
★ The string at the beginning of the number, which is the number in front of the conversion.
★ A string that starts with a non-digit, and the conversion is NaN.
★ Decimal type of string, after conversion to get the original number.
1.3
Turn Boolean type
Boolean ()
★ The number and string are trueafter the turn is complete.
★undefined,null,0 turns to false after completion .
1.4
implicit data-type conversions
JS toString () method number () method and other type conversions