Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Array.prototype.concat vs spread operator v5
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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 YaBrowser/24.4.0.0 Safari/537.36
Browser:
Yandex Browser 24
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
spread operator
26.2M/s
Array.prototype.concat
8.3M/s
View exact numbers
Test name
Executions per second
✓
spread operator
26,244,286 Ops/sec
Array.prototype.concat
8,289,534 Ops/sec
Tests:
Array.prototype.concat
var array = [ "hello", true, 7 ]; var params = [ "goodbye", false, 8 ]; var extraParams = [ "another one", null, 9 ]; var merged = array.concat(params,extraParams);
spread operator
var array = [ "hello", true, 7 ]; var params = [ "goodbye", false, 8 ]; var extraParams = [ "another one", null, 9 ]; var merged = [...array, ...params , ...extraParams];