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?
I mean you can use eval, but it is not the best approach:
eval("var arrayname = sample"); var number = arrayname[1];
Why not just do:
var arrayname = sample; var number = arrayname[1];