Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.prototype.concat vs spread operator vs contact empty array
(version: 0)
Compare the new ES6 spread operator with the traditional concat() method
Comparing performance of:
Array.prototype.concat vs spread operator vs Concat empty array
Created:
3 years ago
by:
Guest
Jump to the latest result
Tests:
Array.prototype.concat
var arr1 = [ "hello", true, 7 ]; var arr2 = [ "bye", false, 5 ]; var other = arr1.concat(arr2);
spread operator
var arr1 = [ "hello", true, 7 ]; var arr2 = [ "bye", false, 5 ]; var other = [ ...arr1, ...arr2 ]
Concat empty array
var arr1 = [ "hello", true, 7 ]; var arr2 = [ "bye", false, 5 ]; var other = [].concat(arr1, arr2);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Array.prototype.concat
spread operator
Concat empty array
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!
Related benchmarks:
concat 2 arrays: Array.prototype.concat vs spread operator
Array.prototype.concat vs spread operator (add)
Array.prototype.concat vs spread operator (fix)
Array.prototype.concat vs spread operator on large array
Array.prototype.concat vs spread operator on small array
Comments
Confirm delete:
Do you really want to delete benchmark?