Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array push vs map v1
Compare the new ES6 spread operator with the traditional concat() method and push
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0
Browser:
Firefox 133
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
array.push
1022315.8 Ops/sec
array.map
8813303.0 Ops/sec
Script Preparation code:
var a1 = [] var a2 = new Array(10).fill(null)
Tests:
array.push
for (let i = 0; i < 10; i++) { a1.push({ itemIndex: i }) }
array.map
a2.map((_, i) => ({ itemIndex: i }))