js数组如何转化为字符串
1、使用 toString 方法。例: 文章地址https://www.yii666.com/learning/js/91.html
var arr = ['a','b','c','d'] var str = arr.toString(); console.log(str); //输出:a,b,c,d console.log(typeof str); //输出:string
2、使用 join 方法。例:
var a = ['a','b','c','d'] arr.join(",") console.log(arr); //输出:a,b,c,d console.log(typeof s); //输出:string
网址:yii666.com文章来源地址:https://www.yii666.com/learning/js/91.html