object destructure

Benchmark created on


Setup

const obj = [...Array(1000).keys()].reduce((acc, i) => {
	acc[i.toString()] = i;
	return acc;
}, {});

Test runner

Ready to run.

Testing in
TestOps/sec
manual
const a = obj["0"];
const b = obj["1"];
const c = obj["2"];
ready
fancy
const { "0": a, "1": b, "2": c } = obj;
ready

Revisions

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