apply vs destructure array parameter

Benchmark created on


Setup

function fooSpread(x,y,z) { return x+y+z; }

function fooArray([x,y,z]) { return x+y+z; }

Test runner

Ready to run.

Testing in
TestOps/sec
Destructure
fooArray([1,2,3]);
ready
Apply
fooSpread.apply(null, [1,2,3]);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.