Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
Fill
78.3M/s
Fill/From
31.1M/s
Apply
9.6M/s
Join (only with single characters!)
6.2M/s
View exact numbers
Test name
Executions per second
✓
Fill
78,298,328 Ops/sec
Fill/From
31,051,720 Ops/sec
Apply
9,629,024 Ops/sec
Join (only with single characters!)
6,237,350 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('');