javascript delete an object or set object = undefined 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
a.x = undefined
a.hasOwnProperty("x") // returns true
delete a.x
a.hasOwnProperty("x") // returns false