Array costructor vs literal

Benchmark created on


Setup

const ARRAY_SIZE = 1000;

Test runner

Ready to run.

Testing in
TestOps/sec
Literal
const arr = [];
arr.length = ARRAY_SIZE;
ready
Constructor
const arr = new Array(ARRAY_SIZE);
ready

Revisions

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