new Array vs array literal

Benchmark created by bbarr on


Test runner

Ready to run.

Testing in
TestOps/sec
new array
var len = 1000, arr = new Array( len ), i;
for ( i = 0; i < len; i++ ) arr[ len ] = len;
ready
[]
var len = 1000, arr = [], i;
for ( i = 0; i < len; i++ ) arr[ len ] = len;
ready

Revisions

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

  • Revision 1: published by bbarr on