<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
// 思路:
// 先将字符串转换为数组,再用数组的reverse方法翻转后join为字符串
var str="hello";
var app=str.split('').reverse().join('');
console.log(app);
</script>
</body>
</html>