I have a string variable which contains the name of an array. What I\'d like to do is access an element of that array. And write it to another variable. How can I do this?
Out of my head...
First declare some global variable
var buf;
Then
var sample = new Array(); sample[0] = 'one'; sample[1] = 'two'; var arrayname = "sample"; eval('buf=' + arrayname + ';'); var number = buf[1];
Damn undesirable way but does what you want...