I have a function looking at a string of 6 characters, my function uses a loop to look at each character in turn and if the value matches a temp value a event occurs.
I have at the beginning of the function
var temp1 = some value
var temp2 = some value
etc
if my logic is true then I want to do the following where x is the array position (1-6)
It would probably be best to show us your function as it isn't at all clear what you are trying to do. Copy/paste the code here and use the </> button at the top of the forum entry window to paste it in.
You could set an array entry for each temp. temp[x] = context.get('T1');
assuming x is a number that increments.
Best to declare temp earlier in your code. let temp = [];
access temp[0] etc