[ECMA] Parsing a JSON string using a variable as name of an JSON-Array

I have a JSON String which I can parse like:

returnvalue = JSON.parse(returnvalue);
var temp= returnvalue.data[i].properties.entries.value.sun;

The last part (“sun”) is detailing to read the SUNDAY JSON-array. Since I’m looking for SUNDAYS only if that is the actual day I’m trying to insert a variable instead of this last element. Could anybody give me a hint?

I might not see the forrest because of all those trees, however… :thinking:.

After chopping some trees…

var myNowDateTime=localTime.now();
var dayOfWeek = myNowDateTime.getDayOfWeek().name().substr(0,3).toLowerCase();
returnvalue = JSON.parse(returnvalue);
var temp=returnvalue.data[i].properties.entries.value