dot access vs assignment

Benchmark created on


Setup

const objectGoodness = new Array(1000).fill("0").reduce((acc, val) => {
	const index = Math.floor(Math.random() * 100000);
	acc[index] = index;
	return acc;
}, {})

objectGoodness.hello = "yay";
const referenceValue = objectGoodness.hello;

Test runner

Ready to run.

Testing in
TestOps/sec
dot index
const value = objectGoodness.hello;
ready
assignment
const yessah = referenceValue;
ready

Revisions

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