Getting error when using global variables
<p>I use a global variables as follows:</p>

<pre><code>var someArray = new Array();

for(i=1;i&lt;=50;i++)

    someArray[i] = 0;
</code></pre>

<p>Then in a function, I use:</p>

<pre><code>if(something == anotherThing)

    someArray[i] = 1; //works fine
</code></pre>

<p>In another function:</p>

<pre><code>if(something == anotherThing)

{
    var i = 1;

    alert(someArray[1]); //returns fine;

    alert(someArray[i]); //returns undefined.

}
</code></pre>

<p>Can't figure out the error.</p>

<p>Even used:</p>

<pre><code>window.someArray[x];
</code></pre>
