Get an array element at a specific index using a variable
myArray = ['a','b','c'].
I then have a variable...
myValue = 2
How can I create a new variable which is the element at the position of myValue? So myNewVariable = 'c'.
I have tried creating a new variable, setting the value to that of the array, then using get with a path of myValue, but I am unable to make it work. Any help would be greatly appreciated.
Other
2 replies