Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array fill vs fill/from vs apply vs join
Fill an array with repeated elements
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0
Browser:
Firefox 120
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Fill
67426752.0 Ops/sec
Fill/From
31709952.0 Ops/sec
Apply
9934439.0 Ops/sec
Join (only with single characters!)
6197903.5 Ops/sec
Tests:
Fill
new Array(5).fill('abc');
Fill/From
Array.from({ length: 5 }).fill('abc')
Apply
Array.apply(null, Array(3)).map(_ => 'abc')
Join (only with single characters!)
Array(6).join('a').split('');