1. var str = "hello"
    2. // [h,e,l,l,o]
    3. // [o,l,l,e,h]
    4. // olleh
    5. var arr = str.split("");// 将字符串分割为数组
    6. console.log(arr); // ["h","e","l","l","o"]
    7. arr.reverse()
    8. console.log(arr); // ["o","l","l","e","h"]
    9. var s = arr.join("")
    10. console.log(s); // 将数组转为字符串