Object creation

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
With one nested object
const user = { name: 'Jane' };
const address = { street: 'Main St.', number: 213 };

for (let i = 0; i < 10; i++) {
  const foo = {
	  ...user
	  ...{
	  	street: address.street,
	  	number: address.number
	  }
	};
}
ready
Without nested object
const user = { name: 'Jane' };
const address = { street: 'Main St.', number: 213 };

for (let i = 0; i < 10; i++) {
  const foo = {
	  ...user
	  street: address.street,
	  number: address.number
	};	
}
ready

Revisions

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