Skip to main content
 首页 » 编程设计

JS数据类型转换

2022年07月15日162落叶无声
  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
阅读延展