array.push(el) vs. array[array.length] = el

Benchmark created on


Preparation HTML

<script>
  var a = [],
      i = [1, 2, 3, 4, 5, 6, 7, 8, 9];
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Array.push(element)
a.push(i);
ready
Array[Array.length] = elem;
a[a.length] = i;
ready

Revisions

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