Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Array concat vs spread operator vs push vs Array.prototype.push.apply
Compare the new ES6 spread operator with the traditional concat() method and push
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0
Browser:
Firefox 152
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 months ago
Benchmark engine:
Benchmark.js
Push
12.3M/s
Array.prototype.push.apply
11.9M/s
spread operator
9.6M/s
Array.prototype.concat
8.5M/s
View exact numbers
Test name
Executions per second
✓
Push
12,311,527 Ops/sec
Array.prototype.push.apply
11,881,520 Ops/sec
spread operator
9,560,489 Ops/sec
Array.prototype.concat
8,522,043 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 ]
Push
var params = [ "hello", true, 7 ]; var other = [ 1, 2 ].push(...params);
Array.prototype.push.apply
var params = [ "hello", true, 7 ]; var other = Array.prototype.push.apply([ 1, 2 ], params);