js数组根据某参数排序

list.sort(function (x, y) {
   return x.param > y.param? 1 : -1
})
list为目标数组
param是参数
原文地址:https://www.cnblogs.com/daicw/p/11983162.html