Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
concat vs spread vs push three arrays to new one
(version: 0)
Compare the spread, concat, push three arrays to new one
Comparing performance of:
concat vs spread vs push
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
const a = [1, 2, 3, 4, 5, 'a', 'b', 'c']; const b = [6, 7, 8, 9, 10, 'd', 'e', 'f']; const c = [11, 12, 13, 14, 'g', 'h', 'i'];
Tests:
concat
var res = [].concat(a, b, c);
spread
var res = [...a, ...b, ...c];
push
const res = []; res.push(...a); res.push(...b); res.push(...c);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
concat
spread
push
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?