摘要: 1、一般我们给一维数组排序,直接用arr.sort()方法就可以了: 1 // 升序 2 arr.sort(function (a, b) { 3 return a - b; 4 }); 5 6 // 降序 7 arr.sort(function (a, b) { 8 return b - a; 9 阅读全文
posted @ 2020-11-24 11:57 onlywu 阅读(138) 评论(0) 推荐(0)