Array concat vs slice

JavaScript performance comparison

Revision 4 of this test case created

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

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

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment