How to create an array

JavaScript performance comparison

Test case created by Johnson Jiang

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
[]
var testarr1=[];
for(var i=0;i<10;i++)
{
testarr1[i]=i;
}
pending…
new Array()
var testarr2=new Array();
for(var i=0;i<10;i++)
{
testarr2[i]=i;
}
pending…
new Array(length)
var testarr3=new Array(10);
for(var i=0;i<10;i++)
{
testarr3[i]=i;
}
pending…

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

Compare results of other browsers

0 comments

Add a comment