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
Push
63.2M/s
Array.prototype.concat
15.6M/s
push + flat
7.0M/s
View exact numbers
Test name
Executions per second
✓
Push
63,151,548 Ops/sec
Array.prototype.concat
15,614,879 Ops/sec
push + flat
7,002,353 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);