Is it possible to know when a property is deleted?

var o = { a: 1 };
delete o.a;

I want to be notified when the property is deleted, similar to the getter and setter accessor descriptors.

Is it possible?

If you can control your environment and ensure it's up to date then great. This article about Object.observer will help.

http://updates.html5rocks.com/2012/11/Respond-to-change-with-Object-observe

Failing that, if you're catering for older browsers, then you'll probably have to write it yourself. Always have performance in the back of your mind. New browsers implement 'Worker threads' and presumably this is what Object.observe will be resourcing. Older browsers execute javascript on a single thread so you don't have this advantage.

You would have to use a timer, but just "one", not multiple... John Resig (Mr jQuery) has written various articles about timers and how they executing on a single thread. Here's one of them:

http://ejohn.org/blog/how-javascript-timers-work/

Note. I haven't tried this myself, so don't know if the performance will be acceptable.

Thanks to @MarkGraham I've found the specifications for the Object.observe() specification proposal for the javascript harmony.

http://wiki.ecmascript.org/doku.php?id=harmony:observe

But this is not implemented in node.js (after a quick search).

I also found Proxies, a more powerful way to intercept operations. It's also from the Harmony but in node.js can be enabled using the --harmony-proxies flag or --harmony to enable all harmony features.

Edit: Node.js implements an older version of the harmony proxies. This is the latest one: direct proxies and the example they provide doesn't work as expected. google groups

There is no built-in "notification" system for these things in js. But I think the (simplest) solution is : call a method with your delete management code ( like you would have done with notifications) after deletion of the property.