Array Literal vs Constructor

Benchmark created by Andrew Petersen on


Test runner

Ready to run.

Testing in
TestOps/sec
literal
var a = ['a', 'b', 'c'];
var read = a[1];
ready
constructor
var a = new Array('a', 'b', 'c');
var read = a[1];
ready
function
var a = Array('a', 'b', 'c');
var read = a[1];
ready

Revisions

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

  • Revision 1: published by Andrew Petersen on
  • Revision 2: published on