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
67.4M/s
Fill/From
31.7M/s
Apply
9.9M/s
Join (only with single characters!)
6.2M/s
View exact numbers
Test name
Executions per second
✓
Fill
67,426,752 Ops/sec
Fill/From
31,709,952 Ops/sec
Apply
9,934,439 Ops/sec
Join (only with single characters!)
6,197,904 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('');