native-for-vs-each

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
native for 1
var array = new Array();
for (var i = 0; i < 10000; i++) {
  array[i] = 0;
}
console.time('native');
ready
native for 2
var l = array.length;
for (var i = 0; i < l; i++) {
  array[i] = i;
}

console.timeEnd('native');
ready
each jquery
console.time('jquery');
$.each(array, function(i) {
  array[i] = i;
});
console.timeEnd('jquery');
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.