js数组根据某参数排序

list.sort(function (x, y) {
   return x.param > y.param? 1 : -1
})
list为目标数组
param是参数
posted @ 2019-12-04 15:30  略略略额  阅读(726)  评论(0)    收藏  举报