SOURCE

console 命令行工具 X clear

                    
>
console
const reverseStr = str => Array.from(str).reverse().join('');
//首先,使用Array.from()将字符串转换为数组

//然后使用Array.prototype.reverse()反转数组

//最后使用Array.prototype.join()使其返回字符串

console.log(reverseStr('abcde'));

//把字符串abcde中的字符顺序颠倒
<!DOCTYPE html> 
<html>
<head>
    <meta charset="utf-8" />   
</head>
<body>

    <script>
    

    </script>
</body>
</html>