array passed as parameter issue
<p>I've got 2dim array set as global variable populated with numbers on row - 0 and strings on row-1.
But when I passed it as a parameter to a function most of its values modifies into undefined but in one strangely value is kept!?!</p>

<pre><code>    function formElements(howMany){ 
        elArr = [];
        var w; var surface;
        for(var j=0; j&lt;howMany; j++){
           w = randomNumber(1,200);
           surface = w*randomNumber(1,100);
           elArr[0] =[j];
           elArr[1] =[j];
           elArr[0][j]=surface;   
           elArr[1][j]='_'+j;
        }
        aFunction(elArr,...other parameters....); //in this function I receive array with these undefined values I mentioned above!!!
    }
    function randomNumber(x,y) {
        return Math.floor((Math.abs(y - x) + 1) * Math.random()) + Math.min(x, y);  
    }
</code></pre>

<p>Could somebody tell me what's wrong?
10x and BR</p>
