js-數組與字符串之間的轉換

1.字符串轉換爲數組數組 var a="a,b,c,d"; var newArry=a.split(","); console.log(newArry);   //打印出  ["a", "b", "c", "d"]spa   2.數組轉換爲字符串code var arry1=['a','b','c','d']; var a=arry1.join(","); console.log(a);  //打
相關文章
相關標籤/搜索