var s = [1,2,3];//数组 var ss = s.join(',');//得到的字符串 console.log(ss); var sss = '1,2,3';//字符串 var ssss = sss.split(',');//按逗号分成数组 console.log(ssss)