delete vs undefined vs null (v111)

Revision 111 of this benchmark created on


Setup

var o = {
     p: 1,
     d: 2
  };

Test runner

Ready to run.

Testing in
TestOps/sec
object.property = false
o.p = false;
ready
object["property"] = false
o["p"] = false;
ready
delete object["property"]
delete o["p"];
ready
object.property = undefined
o.p = undefined;
ready
create new object
if(true) {
  const result = {};
  result.d = o.d;
}
ready
object.property = null
o.p = null;
ready
delete object.property
delete o.p;
ready

Revisions

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