Array name referencing with a variable

Hey all,

fairly simple question (with a long explaination). I have an array, created from the results of another array and it’s position in that array. There are actually multiple arrays It can be created from.

Eg.
Array1: clientName1, clientName2, etc.
Array2: clientType1, clientType2, etc.
Second Array: [clientName1,0], [clientName2,1] OR [clientType1,0] etc.

The code for creating the second array is below:


for (i=0; i<names.length; i++) {
linkArray* = [**names***, i];
}

My issue is, I would like to be able to dynamically adjust the array that it is generating from. This would mean changing the bold bit of the code above.

I have tried declaring a variable (type = names+"*") and using it in the linkArray declaration, however it will not see this as an array reference, only as a variable.

What I want to know is, how do I reference the name of the original array as a variable so I can update it dynamically?