new array vs literal (v27)

Revision 27 of this benchmark created on


Setup

var count = 100;

Test runner

Ready to run.

Testing in
TestOps/sec
Array Literal & push
var newArray = [];
for (var i = 0; i < count; ++i) {
  newArray.push(i);
}
ready
new Array(count)
var newArray = new Array(count);
for (var i = count; i--;) {
  newArray[i] = i;
}
ready

Revisions

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