strange javascript behaviour when calling function in a loop
<p>I'm running a simple test and i get a strange behaviour, here is the js code:</p>

<pre><code> var handler = function(index,params){

    params.id = index;

}

function test(){
    var params = {'id':0};
    console.log(params);
    gradualRepetitionCalls(0,10,params);
}



function gradualRepetitionCalls(index, maxIndex,params) 
{
    if (index &lt; maxIndex) 
    {
        handler(index,params);
        index++;

        gradualRepetitionCalls(index,maxIndex,params);
    }
}

test();
</code></pre>

<p>The strange thing is that the <code>console.log(params)</code> shows that the id is '9' while i would expect it to be '0'. Is <code>console.log()</code> asynchronous?</p>
