[Not a Bug] Array index fails when calculation is included
Hi,
when working with arrays in the parseJson() function, I have faced a behavior that looks like a bug to me.
Normally, when reading the array content dynamically with a variable, we can simply do
Example data
data =
{
fruits: [“apple“, “banana”, “cherry”]
}What works great
parseJson(data, “fruits.“ + index)and it works perfectly, but when including a calculation to the index (in my use case it’s needed), the calculation can not be resolved and displaying the correct text in ProtoPie fails. The text field is then empty.
parseJson(data, “fruits.“ + index - 1)I solved it by using brackets around. Is that behavior wanted or is it a bug?
parseJson(data, “fruits.“ + (index - 1))