Array concat vs slice (v4)

Revision 4 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
concat
var a = [1, 2, 3, 4];
var b = a.concat([]);
ready
slice
var a = [1, 2, 3, 4];
var b = a.slice(0);
ready
for loop push
var a = [1, 2, 3, 4];
var b = [];
var i;
for(i=0; i<a.length; ++i)
{
  b.push(a[i]);
}
ready

Revisions

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