Javascripts Loop Benchmarks
I tested a few looping techniques in the past, but I found a benchmark page which shows over 40 looping techniques and their running times. You can find the benchmark over here.
I tested a few looping techniques in the past, but I found a benchmark page which shows over 40 looping techniques and their running times. You can find the benchmark over here.
In this post I’ll share three might-come-in-handy javascript techniques I often use. These techniques are: using the javascript ‘with’ keyword, using the ‘String.indexOf’ function to shorten if conditions, and using the ‘arguments’ array to get a better understanding of how (undocumented) functions work.
While I’m a great fan of Javascript Libraries like Prototype and Mootools, I’m less happy with their iterators. Iterating through a large array just takes ages using Array.each(). I think the most annoying thing with Javascript is that it freezes the browser while it’s being processed.