76
rated 0 times
[
82]
[
6]
/ answers: 1 / hits: 18622
/ 15 Years ago, thu, june 4, 2009, 12:00:00
I have several arrays in Javascripts, e.g.
a_array[0] = abc;
b_array[0] = bcd;
c_array[0] = cde;
I have a function which takes the array name.
function perform(array_name){
array_name = eval(array_name);
alert(array_name[0]);
}
perform(a_array);
perform(b_array);
perform(c_array);
Currently, I use eval() to do what I want.
Is there any method not to use eval() here?
More From » javascript