let aa = '1,2,3,4,5,6,7,8,9'
let bb = aa.split(',').reverse().join(',')
console.log(bb)
let aa = '123456789'
let bb = [...aa].reverse().join('')
console.log(bb)
let aa = '1,2,3,4,5,6,7,8,9'
let bb = aa.split(',').reverse().join(',')
console.log(bb)
let aa = '123456789'
let bb = [...aa].reverse().join('')
console.log(bb)
本文标题:reverse()反转数组 split('')字符串转数组 j
本文链接:https://www.haomeiwen.com/subject/sbpeeltx.html
网友评论