Set a capacity of array

Benchmark created on


Setup

const size = 500;

Test runner

Ready to run.

Testing in
TestOps/sec
Set a capacity of array
const arr = Array(size);
for(let i=0; i<size; i++) {
	arr.push(i);
}
ready
Set a normal array
const arr = [];
for(let i=0; i<size; i++) {
	arr.push(i);
}
ready

Revisions

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