I'm doing a loop like this :
for (var index in data) 
{
    console.log(index);    
    $http.post('server.php')
    .success(function(data, status) 
    { 
        console.log(index); 
    }
}
The first console.log() displays : 0,1,2,3,4,5
The second console.log() displays : 5,5,5,5,5,5
And I have really no idea why. Is it because of the fact that i'm using 2 variables named data ? I tried renaming one, but it didn't fixed the issue.
 
     
    