字符串用逗号拼接,拆分成数组

const str = 'aaa,bbb,ccc,'

console.log(str.split(','))

//打印结果 ['aaa','bbb','ccc']

你可能感兴趣的:(字符串用逗号拼接,拆分成数组)