I have the following situation:
var count = something.length;
google.maps.event.addDomListener( div, 'click', function( event ) {
for( a = 0; a < count; a++ ) {
// action 1
}
});
google.maps.event.addDomListener( div, 'mouseover', function( event ) {
for( a = 0; a < count; a++ ) {
// action 2
}
});
google.maps.event.addDomListener( div, 'mouseout', function( event ) {
for( a = 0; a < count; a++ ) {
// action 3
}
});
I have several situations like this and I seem to have too many loops in total.
As you can see, all loops loop through same array but actions are different.
Could I solve similar situation with only 1 for loop / recycle the looping?