首页
mac
it
登录
6mi
u
盘
搜
搜 索
it
JavaScript内置排序方法sort实现排序操作
JavaScript内置排序方法sort实现排序操作
mac
2022-06-30
26
var
arr = [10,8,6,9,1,7,2,13,5,1,9
];
//
sort排序
arr.sort(
function
(a,b){
//
可以改变数组本身的排序方法
return
a-
b; }) console.log(arr);
转载于:https://www.cnblogs.com/ooo888ooo/p/11402635.html
转载请注明原文地址: https://mac.8miu.com/read-64313.html
最新回复
(
0
)