Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
array arg vs spread args
(version: 1)
Comparing performance of:
array vs spread
Created:
2 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function classesArray(classes) { return classes.filter(Boolean).join(' '); } function classesSpread(...classes) { return classes.filter(Boolean).join(' '); }
Tests:
array
classesArray([ 'Foo', undefined, 'Bar', ])
spread
classesSpread( 'Foo', undefined, 'Bar', )
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
array
spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one month ago
)
User agent:
Mozilla/5.0 (Android 15; Mobile; rv:148.0) Gecko/148.0 Firefox/148.0
Browser/OS:
Firefox Mobile 148 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
array
6531498.0 Ops/sec
spread
6656364.5 Ops/sec
Related benchmarks:
array destructuring vs direct access 2
ClassList test
another tesatdqd
arrayFilter vs arraySet for unique Array
Compare lodash isEmpty and length comparison on string arrays
array.join vs string literal
array.length !==0 vs array.length > 0
array.includes vs if &&
Array.includes vs Logic or
Comments
Confirm delete:
Do you really want to delete benchmark?