Get Object Keys

Benchmark created by cooldude on


Description

Testing getting object keys

Preparation HTML

<script>
  var obj = {
   a: 1,
   b: 2,
   c: 3
  };
  var arr = [];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Array Push
for (var key in obj) {
 arr.push(key);
}
ready
For in
for (arr[arr.length] in obj);
ready

Revisions

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