A for loop over array.length (stored in an intermediate variable so it isn't 
requeried in the loop) is faster than anything that uses `in` internally, 
because there's no chaff to throw out -- it's all seek and no scan.

Note that not all historical JS engines enum'd all the Array proto props on an 
array literal; on the other side, some engines enum'd more props they were 
supposed to. The disparity led to some howtos that really should be taken down, 
but hey, people still want their ad clicks, I guess. :)

-- S.

Reply via email to