clone array

JavaScript performance comparison

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 clone
var a = [1,2,3],
    b = a.concat([]);
 
pending…
slice clone
var a = [1,2,3],
    b = a.slice(0);
pending…
foreach clone
var a = [1,2,3],
    b = [];
for(var i=0,len=a.length;i<len;i++){
    b[i] = 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