for in object key

Benchmark created on


Setup

var temp = {
      x: 0,
      y: 0,
      z: 0
    };

Test runner

Ready to run.

Testing in
TestOps/sec
for in
for (var i in temp) {
  console.log(temp[i]);
}
ready
obj key
var obj = Object.keys(temp);
var length = obj.length;

for (var i = 0; i != length; i++) {
  console.log(temp[obj[i]]);
}
ready

Revisions

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