arr initialization

Benchmark created on


Setup

const size = 10;

Test runner

Ready to run.

Testing in
TestOps/sec
literal
const a = [];

for (let i = 0; i< size; i++) {
	a[i] = i;
}
ready
constructor reserve
const a = new Array(size);

for (let i = 0; i< size; i++) {
	a[i] = i;
} 
ready
constructor no reserve
const a = new Array();

for (let i = 0; i< size; i++) {
	a[i] = i;
} 
ready

Revisions

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