Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JavaScript V8 Array.push vs spread operator
Which is faster
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0
Browser:
Firefox 119
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Array.push in for loop
50965.1 Ops/sec
Spread operator
5513.2 Ops/sec
Tests:
Array.push in for loop
const arr1 = Array(1000).fill(0); const arr2 = Array(0); for (const el of arr1) { arr2.push(el) }
Spread operator
const arr1 = Array(10000).fill(0); let arr2 = Array(0); for (const el of arr1) { arr2 = [arr2, el] }