A bit of a beginners question but I am new to JS and Node-RED.
I am reading values directly from my solar inverter web interface and am struggling with the kWh value. I have the data from the inverter in an array that lists the values in the order of days of the month. This is what I put in a function block (global.today contains the day of the month):
I want to select the correct value using var today: payload: msg.payload[today]
That does not work. If I test by sticking a number in,  for example, it does work.
Is there a solution for this?