如何从 javascript 中的 JSON 获取值是我的代码
var obj={"0.5":0.009333, "0.21":0.048667,"0.31":0.070667};
var value =0.21;
var p=0;
for(i=0; i<= obj.length ;i++){
if(value== obj[i]){
p = obj[i]; //here i want p=0.048667
console.log("psr is :"+p);
}
}