First: the loops for(a in obj) and for(var i=0;i<array.length;i++) should be used according to the nature of the collection. If the collection is an object, use first loop (because an object has no length property, or better say it has the length=0), if the collection is an array, use the second one. Thus, the speed comparison has no base.
- a backward loop is faster than a normal one:
- a while loop is faster than the for() loops
var i=0, a;
...//do something with a
- a switch/case statement is faster that any loop. But for a "long" array (or an object with many properties) it is not practical.
You might want to add a zero to the year estimate ...
In fact I am one who has not switched to IE8. But I have a good reason: I am a web designer and programmer and I need to know how a page looks like in IE7 rather that IE8 - assuming that what works in IE7 will work in IE8 as well, mainly if I use a silly but useful meta tag as :
Use the developer toolbar (F12 key) in IE8 to switch between IE8, IE7 and quirks mode. Works quite well.
Does it? Hmm... all the "parallel IE" applications I have used so far were not quite accurate, mainly for IE6 (oh, how I hate that version...). I suppose it is the time to give that IE8 facility a try. Moreover, IE8 looks like a decent browser. Thanks for the tip.
IE7, IE8? Luck you. Most of the corporates I produce systems for still use IE6. It really is fun how they expect widget heavy desktop like AJAX apps to run well in IE6. We show them how it runs in Chrome and they say "wow" but will they upgrade? No!