Array .concat() vs. .push() (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script>
  var arr = new Array(10),
      toAdd = new Array(10);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
.push()
for (var i = 0, iM = toAdd.length; i < iM; i++) {
 arr.push(toAdd);
}
ready
.concat()
arr = arr.concat(toAdd);
ready

Revisions

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