I worked a lot with PHP and now I am slowly learning javascript. I am working on setting the zIndex for some google map markers. I am using a for in loop. I would expect the variable "i" to contain a number that I can use to set the zIndex, but if I do, it breaks the code and the markers do not show up on the map. If I use numbers, the code works. If I feed a number into a variable and use that variable, the code also works. So I can make this work, but I would like to understand why using the i variable is not working. 
When I output the i into a div - it shows numbers 1,2,3,4,5,6,7...
for (var i in data.results) { 
    var myLatlng = new google.maps.LatLng(data.results[i].latitude,data.results[i].longitude);
    markers[i] = new StyledMarker({styleIcon:new StyledIcon(StyledIconTypes.BUBBLE,
        {
            color:"bbbbbb",
            text:data.results[i].id
        }),
        position:myLatlng,
        zIndex: 1,                             
        map:map
    });
    google.maps.event.addListener(markers[i], 'mouseover', function ()
    {
        this.setOptions({zIndex:100});
    });
    google.maps.event.addListener(markers[i], 'mouseout', function ()
    {
        this.setOptions({zIndex:1});
    });
}
 
     
    