Possible Duplication:
Retrieve variable from string
I am facing a scenario where I have an array named myArray and a variable called myVar. The value stored in myVar is 'myArray', which happens to be the name of the array. Is there a way to refer to the elements of the array using the myVar variable? To illustrate, here is some sample code:
var myArray = {1, 2, 3};
var myVar = "myArray";
Your help is greatly appreciated!