http://jsperf.com/testing-foreach-vs-for-loop
It was my understanding that Test Case 2 should run more slowly than Test Case 1 -- I wanted to see how much more slowly. I
Maybe the for() is slower because the loop applies 'array.length' to each iteration, to get the array's length.
Try:
var nri = array.length; for( var i = 0; i < nri; i++ ){ // ... }