var arr = [
{name: '张三', age: 15},
{name: '李四', age: 18},
{name: '王五', age: 16}
]
Math.max.apply(Math,arr.map(item => item.age )) // 18
Math.min.apply(Math,arr.map(item => item.age )) // 15
数组对象获取最大值,最小值问题
最新推荐文章于 2024-01-30 19:05:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)