字符串转换为数组:
1 正则表达式var string=“abcdedef”var obj=string.replace(/(.)(?=[^$])/g,"$1,").split(","); //字符串转化为数组2 splitvar obj2 = string.split(""); //字符串转化为数组数组转换为字符串var a = [1,2,3];a.join() a.join(',') a.join('|') a的类型被转换为字符串
var
a = [1,2,3];