Problem accessing global variable in javascript
<p>I am working on google maps and I need to create an array of items. Here is my pseudo code:</p>

<pre><code>&lt;script&gt;
var myvar=new array();

function initialize(){
   for i=1 to 10
   {  
        callAnotherFunct(i);
   }

   access myvar() here; 
}


function callAnotherFunct(i){
    myvar=array_element_i;
}

&lt;/script&gt;
</code></pre>

<p>I am expecting myvar to behave as a global variable but it is not. I cannot get any values for myvar in the initialize().</p>

<p>What am I doing wrong here?</p>
