Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Spread operator vs apply vs normal vs destruct
(version: 0)
Compare the differing ways you can call a function with arbitrary arguments dynamically
Comparing performance of:
spread vs apply vs normal vs destruct
Created:
2 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
function test(a , b , c , d , e) { return a + b + c + d + e } var using = (new Array(5)).fill(null).map((e, i) => (i)); const [a , b , c , d , e] = using
Tests:
spread
test(...using);
apply
test.apply(null, using)
normal
test(using[0] , using[1] , using[2] , using[3] , using[4])
destruct
test(a , b, c , d , e)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
spread
apply
normal
destruct
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?