For loop vs Array constructor for initializing array

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Array constructor
const group = new Array(5).fill([]);
ready
For loop
const group = [];
for (let i = 0; i < 5; i++) {
  group.push([]);
}
ready

Revisions

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