1.字符串转换成数组:
var arr = "1, 2, 3, 4, 5, 6";
arr.split(","); // ["1","2","3","4","5","6"]
2.数组转换成字符串:
var str = [1, 2, 3, 4];
str.join(","); // "1, 2, 3, 4"
2021-08-20 16:28:33
var arr = "1, 2, 3, 4, 5, 6";
arr.split(","); // ["1","2","3","4","5","6"]
var str = [1, 2, 3, 4];
str.join(","); // "1, 2, 3, 4"