Javascript's equivalent of destruct in object model

php_nub_qq picture php_nub_qq · Mar 21, 2014 · Viewed 60.9k times · Source

Since I've dealt in the past with javascript's funky "object model", I assume there is no such thing as a destructor. My searches were mildly unsuccessful, so you guys are my last hope. How do you execute stuff upon instance destruction?

Answer

Thomas Junk picture Thomas Junk · Mar 21, 2014

MDN is a nice resource for JS. No, there is nothing like calling a function when an object ceases.