js中数据类型转为字符串 1.toString()方法 注意:undefined和null转换不了字符串 2.String()方法解决了undefined和null 3.字符串拼接形式 var num=1 console.log(num+’’)