array vs object destructuring

Benchmark created on


Setup

const foo = [1, 2, 3, 4, 5]

Test runner

Ready to run.

Testing in
TestOps/sec
array
const [{}, a, b, {}, d] = foo;
ready
object
const {1: a, 2: b, 4: d} = foo;
ready

Revisions

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