javascript delete an object or set object = undefined differences code example
Example: delete object property vs undefined assignment javascript
a.x = undefined
a.hasOwnProperty("x") // returns true
delete a.x
a.hasOwnProperty("x") // returns false