js 查找对象数据中某属性的最大值


var list=[{id:1,name:'张三',score:123},{id:2,name:'李四',score:135}]

找出数组list中最好的成绩

var max = Math.max.apply(Math, this.list.map(i => {return i.seq })); 结果是135   找出数组中list中成绩最差的成绩 var min= Math.min.apply(Math, this.list.map(i => {return i.seq })); 结果是123

相关