<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var a = [9,2,33,66,55,34,1,91,88];
function sortNumber(b,c){
return b - c;
}
alert(a.sort(sortNumber));
</script>
</body>
</html>
(练习)数组:数组元素排序!
最新推荐文章于 2024-09-06 13:29:35 发布