An array is undefined in javascript
<p>I am actually trying to retrieve something for a sqlite database and store the results in an array. So I create an array and pass it as an argument to the function. Then after the function returns, the array remains undefined. What is the problem with that?</p>

<pre><code>function initGraphView()
{
   var resultsArray=new Array(12);
   getGraphData(defaultQueryString,resultsArray);
   alert(resultsArray[0]); //undefined
}
</code></pre>

<pre>
    getGraphData=function(queryString,resultsArray)
{
dbConnection.transaction(function(tx){
 tx.executeSql(queryString, [],
    function(SQLTransaction, data)
    {
        for(var i=0;i</pre>
