SOURCE

console 命令行工具 X clear

                    
>
console
//实现把字符串中的字符顺序颠倒。

function reverse(f_str){
    
    //根据空字符串拆分成数组
    fx_str = f_str.split('');
    //颠倒字符顺序,将数组转回字符串
    new_str = fx_str.reverse().join('');

    return new_str;
}

document.write("Forever Happy !" + "<br/>");
document.write("----颠倒字符顺序----" + "<br/>");
document.write(reverse("Forever Happy !"));
<!DOCTYPE html> 
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
 
</head>
<body>
</body>
</html>