1.字符串转数组的方法
var a=“1,2,3,4”;
var c=a.split(",");
console.log©
将字符串转换为数组了
2.数组转字符串
var a, b;
a = new Array(0,1,2,3,4,5);
b = a.join("-");
console.log(b)
1.字符串转数组的方法
var a=“1,2,3,4”;
var c=a.split(",");
console.log©
将字符串转换为数组了
2.数组转字符串
var a, b;
a = new Array(0,1,2,3,4,5);
b = a.join("-");
console.log(b)