Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Array.prototype.concat vs spread operator vs flat
Compare the new ES6 spread operator with the traditional concat() method
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 18
Operating system:
iOS 18.2.1
Device Platform:
Mobile
Date tested:
one year ago
Benchmark engine:
Benchmark.js
spread operator
185.5M/s
Array.prototype.concat
16.5M/s
Array.prototype.flat
12.0M/s
View exact numbers
Test name
Executions per second
✓
spread operator
185,503,728 Ops/sec
Array.prototype.concat
16,544,236 Ops/sec
Array.prototype.flat
11,976,148 Ops/sec
Tests:
Array.prototype.concat
var params = [ "hello", true, 7 ]; var other = [ 1, 2 ].concat(params);
spread operator
var params = [ "hello", true, 7 ] var other = [ 1, 2, ...params ]
Array.prototype.flat
var params = [ "hello", true, 7 ]; var other = [1, 2, params].flat()