in operator or array

JavaScript performance comparison

Test case created


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]];
in operator
var img = document.createElement('img');
for(var i in img) {
  var prop = img[i];

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

Compare results of other browsers


Comment form temporarily disabled.

Add a comment