let a = 'john-reese'
//字符串转为数组,根据“-”拆分
let b = a.split("-")
console.log(b) //['john', 'reese']
字符串转数组
于 2022-02-17 11:18:53 首次发布
let a = 'john-reese'
//字符串转为数组,根据“-”拆分
let b = a.split("-")
console.log(b) //['john', 'reese']