找出数组对象某一项值得最大值

const d = res.data
const max = Math.max(...d.map(item => parseInt(item.num) || 0)) / 0.8

map遍历出所需查找得key值对应得num
Math.max 找出数组中得最大值

猜你喜欢

转载自blog.csdn.net/weixin_44845483/article/details/125084563
今日推荐