In Javascript we can use ‘set’ and ‘get’ to define properties, but is there any way to define ‘delete’ or hook it whenever delete statements are called on properties?
My Javascript app is specified to Chrome, so any Chrome-specified solutions are welcome.
If
deletewere a function you could override, but unfortunately it is an operator, so no luck on hooking into that. Your best bet is hooking into “onchange” which works with JS objects and running your own code:ex: