Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array push vs concat vs push + flat to merge to arrays
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array.prototype.concat
15614879.0 Ops/sec
push + flat
7002353.0 Ops/sec
Push
63151548.0 Ops/sec
Tests:
Array.prototype.concat
let params1 = [ "hello", true, 7 ]; const params2 = [ "hello", true, 7 ]; params1 = params1.concat(params2);
push + flat
let params1 = [ "hello", true, 7 ]; const params2 = [ "hello", true, 7 ]; params1.push(params2) params1 = params1.flat()
Push
let params1 = [ "hello", true, 7 ]; const params2 = [ "hello", true, 7 ]; params1.push(...params2);