in operator or array

JavaScript performance comparison

Test case created

Info

Perf check for in operator over object or array.

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
keys array
var img = document.createElement('img');
var keys = Object.keys(img);

for(var i=keys.length;k>0;k--) {
 var prop = img[keys[i-1]];
}
pending…
in operator
var img = document.createElement('img');
for(var i in img) {
  var prop = img[i];
}
pending…

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

Compare results of other browsers

0 comments

Add a comment