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:
5 months ago
by:
Guest
Go 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:
4 months 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
spread
6.7M/s
array
6.5M/s
View exact numbers
Test name
Executions per second
✓
spread
6,656,364 Ops/sec
array
6,531,498 Ops/sec
Related benchmarks
array destructuring vs direct access 2
Compare lodash isEmpty and length comparison on string arrays
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?