New vs Del

Benchmark created on


Setup

const a = Array.from({length: 10000}).map( i => ({id: i, foo: 'delete me' }))

Test runner

Ready to run.

Testing in
TestOps/sec
Delete
for ( var o in a ) {
	delete o.foo;
}
ready
New
const b = [];

const b = a.map( ({id}) => ({id}));
ready

Revisions

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