Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
spread vs concat vs unshift with slice
(version: 0)
spread vs concat vs unshift with slice
Comparing performance of:
arrayUnshift vs arrayConcat vs arraySpread vs arrayDoubleSpread
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var array = [1,2,3,4,5,6,7,8];
Tests:
arrayUnshift
array.unshift(...array.slice(4));
arrayConcat
array = array.slice(4).concat(array);
arraySpread
array = [...array, ...array.slice(4)];
arrayDoubleSpread
const [first, second, third, ...others] = array; array = [...array, ...others];
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
arrayUnshift
arrayConcat
arraySpread
arrayDoubleSpread
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?