Array does not get filled with function
<p>Can someone explain to me why array(defined outside function) does not get filled by the function. So I could use it for other functions</p>

<p>My code:</p>

<pre><code>var points = [];
var eilutes = [];
var query = connection.query('SELECT * FROM ping', function(err, eilutes){

    //if (err) throw err;

    for (var i in eilutes){
        points.push(eilutes[i]);
    }
    console.log(points[1]);  //// Result is returned
    console.log(eilutes[1]); //// Result is returned
});
console.log(points[1]); //// promts: undefined
console.log(eilutes[1]); //// promts: undefined
</code></pre>
