<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
//合并数组
var arr1 = ["Hello","World","PHP","Js"];
var arr2 = ["name","age","sex","weight"];
var arr3 = arr1.concat(arr2);//合并数组,arr1合并arr2
// document.write(arr3);
//数组排序
var na = [3,5,7,1,6,4,2];
document.write(na.sort(function(a,b){
return a-b;//升序
return b-a;//降序
}));
//追加
var yy = ["w","h"];
yy.push("p");//追加字符p
document.write(yy);
//反转
var tt = ["o","l","l","e","h"];
document.write(tt.reverse());//反转数组
</script>
</body>
</html>