const compareDown = (property, child) => (a,b) => (b[property][child] - a[property][child]);
dataList.sort(compareDown('overall', 'value'));
const compareDown = (property, child) => (a,b) => (b[property][child] - a[property][child]);
dataList.sort(compareDown('overall', 'value'));
本文标题:js根据对象的深层属性给数组排序
本文链接:https://www.haomeiwen.com/subject/xgsfrqtx.html
网友评论