Javascript Read Array Values from Function dynamically
<p>How can I pass a array name into a function and read values dynamically?</p>

<p><em><strong>Dynamically i have generated array as follows</em></strong></p>

<pre><code>fruits[0] = "Banana";
fruits[1] = "Orange";
fruits[2] = "Apple";
</code></pre>

<p>//Hyperlink to activate function below</p>

<pre><code>I have a function in hyeperlink &lt;a href="javascript: activate('1', 'fruits')"&gt;Click Me&lt;/a&gt;
</code></pre>

<p>Below is the function </p>

<pre><code>function activate(idNumber, arrayName)
{
  alert('id is:'+ idNumber); **//Working** 
  alert(arrayName[idNumber]); **//Not working must print fruits[1]**

}
</code></pre>
