数据类型转换

  number.toString()//数字转字符串 null,undefined 不能使用toString转换为字符串
number.toString()//null,undefined   String()转换方法可以转换字符串
parseInt("string")
parseFloat("string")//字符串转数字
console.log(Boolean("123"); //把字符串的hello转成布尔值 一般都是true  ,null,undefined,NaN ,0 ,"" 转换之后是false
原文地址:https://www.cnblogs.com/wulicute-TS/p/15147872.html