See please the following code which works fine:
var fileContent = app.ReadFile("/sdcard/request-result.json"); // Get JSON content
var count = 0;
var values = JSON.parse(fileContent);
var type = "airTemperature";
console.log(values.hours[count].airTemperature.sg); // this display the right value
I would like to use content of type ("airTemperature") instead of airTemperature to get the same result:
console.log(values.hours[count].keys(type).sg); // Something like this but this doesn't work!