I have an object:
{
"status": 200,
"error": false,
"msg": "Successful response",
"data": {
"horodate": [ "2016-10-13 00:00:00", "2016-10-13 00:30:00", ... ],
"value": [ 2609.479, 2390.026, 2320.394, 2276.602, 2247.151, ... ]
}
}
I'm getting the max and min value:
$.getJSON(url, function (data) {
// ...
var arr = Object.keys(data['data']['value']).map(function(key) {
return data['data']['value'][key];
});
var min = Math.min.apply(null, arr);
var max = Math.max.apply(null, arr);
console.log(min); //2609.479
console.log(max); //2247.151
But how can I get the horodate
of those min and max values when I retrieve min and max from the object?