gpt4 book ai didi

javascript - 获取对象中具有最大索引键的属性

转载 作者:行者123 更新时间:2023-11-30 08:27:23 25 4
gpt4 key购买 nike

<分区>

从以下对象中,我如何从具有最大索引键(即 4)的属性中获取“空气”读数? (30.9)

{
1: {
air: "31.2",
evap: "25.3",
t_condenser: "43.8"
},
2: {
air: "31.1",
evap: "25.3",
t_condenser: "43.6"
},
3: {
air: "31.0",
evap: "25.3",
t_condenser: "43.5"
},
4: {
air: "30.9",
evap: "25.2",
t_condenser: "43.3"
}
}

我尝试了以下方法,试图获取最后一个 key ,但它只是读取未定义:

$.getJSON("handler.php?action=fetchLAE", function(data){

console.log(data.length);

});

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com