var array=[
        {
            "index_id": 119,
            "area_id": "18335623",
            "name": "满意度",
            "value": "100"
        },
        {
            "index_id": 119,
            "area_id": "18335624",
            "name": "满意度",
            "value": "20"
        },
        {
            "index_id": 119,
            "area_id": "18335625",
            "name": "满意度",
            "value": "80"
        }
];

取最大值:Math.max.apply(Math, array.map(function(o) {return o.value}))

取最小值:Math.min.apply(Math, array.map(function(o) {return o.value}))

说明:array是我们上面定义的数组,o.value就是要比较的字段。

 

本文来自互联网:https://blog.csdn.net/cargelzhong/article/details/81458610

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2021-06-20
  • 2021-09-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2021-06-27
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案