> 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.
Most likely, there is a trailing comma in the array definition, like this: var x = [1,2,3,] IE treats that as a 4-element array with an undefined element at the end. Firefox takes the C route and ignores the trailing comma.