Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array.prototype.concat vs spread operator on NodeList 2
(version: 0)
Compare the new ES6 spread operator with the traditional concat() method
Comparing performance of:
slice vs spread operator vs push apply into empty array vs Array.from vs Object.values vs A-Push Apply reuse Array
Created:
4 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var dom = document.body.querySelectorAll('*')
Tests:
slice
var other = Array.prototype.slice.call(dom);
spread operator
var other = [ ...dom ]
push apply into empty array
var other = []; [].push.apply(other, dom)
Array.from
var other = Array.from(dom);
Object.values
var other = Object.values(dom)
A-Push Apply reuse Array
var arr = []; arr.push.apply(arr, dom)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (6)
Previous results
Fork
Test case name
Result
slice
spread operator
push apply into empty array
Array.from
Object.values
A-Push Apply reuse 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 vs spread 1
Array.prototype.concat vs spread operator (add)
Array.prototype.concat vs spread operator (fix)
Array.prototype.concat vs spread operator real
Array.prototype.concat vs spread operator on small array
Comments
Confirm delete:
Do you really want to delete benchmark?