219
2019-12-04 17:01:06 219阅读 0喜欢

字符串转数组split() 函数和数组转字符串join() 函数实例

var string="abcdefg"
console.log(string.split(''));
// 输出结果:["a", "b", "c", "d", "e", "f", "g"]

var array=["a", "b", "c", "d", "e", "f", "g"];
console.log(array.join(','));
// 输出结果:a,b,c,d,e,f,g
881访问人次
Camila Waz 2021-07-30 16:08:54
2019-10-12 09:34:11 198阅读 0喜欢
2019-04-26 11:07:56 69阅读 0喜欢