Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Adding an element to array: concat vs spread vs push
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/129.0.0.0 Safari/537.36
Browser:
Chrome 129
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array.prototype.concat
6257504.0 Ops/sec
spread operator
11808893.0 Ops/sec
Push
12828865.0 Ops/sec
Script Preparation code:
var el = 3; var arr = [ 1, 2 ];
Tests:
Array.prototype.concat
var other = arr.concat(el);
spread operator
var other = [...arr, el]
Push
var other = arr.push(el);