JS之数据类型转换

数据类型转换 其他类型转为字符串(string) 1. x.toString() console.log理论上只能接受字符串: console.log(1)将转换成console.log( (1).toString() ) 2. String(x) 3. 简便方法: x + '' > 1+'1' < '11' 等价于(1).toString()+'1' 其他类型转为数值(number) Numbe
相关文章
相关标签/搜索