如何将数组名称传递给函数并动态读取值?
我动态地生成了如下数组
fruits[0] = "Banana";
fruits[1] = "Orange";
fruits[2] = "Apple";
//下面的超链接激活功能
I have a function in hyeperlink <a href="javascript: activate('1', 'fruits')">Click Me</a>
下面是函数
function activate(idNumber, arrayName)
{
alert('id is:'+ idNumber); **//Working**
alert(arrayName[idNumber]); **//Not working must print fruits[1]**
}