[jQuery] $.each() versus for() -- array size inconsistency between IE and FF

[jQuery] $.each() versus for() -- array size inconsistency between IE and FF


I just posted something around problems with IE counting an object
variable size differently than FF does.
I dont know how to fix it without changing the $.each() statement with
a for() loop.
                for(i=0; i<J.length-1; i++){
                    alert (J.length);
                }
this works.
But this code below makes IE think J.length is larger by 1, compared
to FF. Because of that, IE throws a fatal error in its last loop,
since J is no longer defined.
                $(J).each(function(i){
                    alert (J.length);
                });
Am I wrong to assume that his each() function from jquery should
behave exactly the same way across browsers?
I'm sure there is something I'm missing, I just don't know what.