正则表达式替换法: var str = "123456789" function reverseStr(str) { return str.replace(/./g, (char, index) => { return str[str.length - index - 1] }) } reverseStr(str) 字符转数组经过翻转再转字符法: var str = "123456789" function reverseStr(str) { return str.split("").reverse().join("") } reverseStr(str)