一、数组转字符串用join()
var a, b;
a = new Array(0,1,2,3,4);
b = a.join("-");
//"0-1-2-3-4"
二、字符串转数组用split()
var s = "abc,abcd,aaa";
ss = s.split(",");// 在每个逗号(,)处进行分解。
//["abc", "abcd", "aaa"]
标签:abcd,abc,aaa,js,转换方法,数组,字符串,join
来源: https://www.cnblogs.com/ywyth/p/15381054.html