Removing Variables from an Object (v2)

Revision 2 of this benchmark created by MissFriday on


Setup

const obj = { a: 1, b: 2, c: 3 };
  
  const omit = (prop, { [prop]: _, ...rest }) => rest;

Test runner

Ready to run.

Testing in
TestOps/sec
Create a Copy
omit('a', obj)
ready
Use Delete Statement
delete obj.a;
ready
Set Undefined
obj.a = undefined;
ready

Revisions

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

  • Revision 1: published by BretCameron on
  • Revision 2: published by MissFriday on
  • Revision 3: published by MissFriday on