Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Delete property from object delete/nullify/undefined/reflect.delete/deconstruction
(version: 1)
Testing the performance of using `delete` keyword VS setting prop to null to remove an property of an object
Comparing performance of:
`delete` keyword vs Setting prop to `null` vs Reflect.deleteProperty vs Deconstructor vs Setting prop to `undefined`
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var person = {name: "neka", age: 1, status: 'A', married: false, owner: false };
Tests:
`delete` keyword
delete person.status; delete person.married;
Setting prop to `null`
person.status = null person.married = null
Reflect.deleteProperty
Reflect.deleteProperty(person, 'status') Reflect.deleteProperty(person, 'married')
Deconstructor
const { status, married, ...rest } = person
Setting prop to `undefined`
person.status = undefined person.married = undefined
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
`delete` keyword
Setting prop to `null`
Reflect.deleteProperty
Deconstructor
Setting prop to `undefined`
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?