Object to Array

Benchmark created on


Description

Converting object to array

Preparation HTML

<script>
  var obj = {
   0: [52, 15],
   5: [62, 778, 83, 1],
   9: [4],
   length: 3
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Cast
var arrayz = Array.prototype.slice.call(obj, 0);
ready
Loop
var arrayz2 = [];
for (var k in obj) {
 arrayz2.push(obj[k]);
}
ready

Revisions

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