标签:body tran http sort function turn cat public rev
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title>
</head>
<body>
<script>
//1.reverse,sort
var ar=[1,6,3,8,100];
// ar.reverse();
// console.log(ar);//[100, 8, 3, 6, 1]
// ar.sort(mysort);
// console.log(ar);//[1, 3, 6, 8, 100]
// function mysort(a,b) {
// return a-b;
//
// }
//2.concat方法
console.log(ar.concat(66,99))
</script>
</body>
</html>
javascript的reverse,sort方法,concat方法
标签:body tran http sort function turn cat public rev
原文地址:https://www.cnblogs.com/startl/p/12238591.html