js将字符串字符颠倒
let a = 'abcdefg'
let aList = a.split('') //将a里面的所有字符按顺序依次放入aList数组中
console.log(aList) //["a", "b", "c", "d", "e", "f", "g"]
aList = aList.reverse() //将aList数组顺序颠倒
console.log(aList) //["g", "f", "e", "d", "c", "b", "a"]
aList = aList.join('') //aList中的所有元素放入一个字符串,元素是通过括号内指定的分隔符进行分隔的
console.log(aList) //gfedcba`