Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array = Array.concat(Array) vs Array.push(...Array)
Compares array concatenation via the classic "concat" method and the "push" with a spread operator.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0
Browser:
Firefox 133
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array.Concat(Array)
2104.1 Ops/sec
Array.push(...Array)
3830931.2 Ops/sec
Script Preparation code:
let baseArray = [1, 2, 3, 4]; const newNeighbors = [5, 6, 7, 8, 9, 0];
Tests:
Array.Concat(Array)
baseArray = baseArray.concat(newNeighbors);
Array.push(...Array)
baseArray.push(...newNeighbors);