array generate

Benchmark created on


Setup

var n = 1000_000

Test runner

Ready to run.

Testing in
TestOps/sec
fill
new Array(n).fill('---')
ready
for
var ans = []
for (let i = 0; i < n; i++) {
	ans.push('---')
}
ready
fill & map
new Array(n).fill(1).map(() => '---')
ready

Revisions

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