Javascript's equivalent of destruct in object model [duplicate]

你。 提交于 2019-11-28 02:24:40

问题


This question already has an answer here:

  • When are JavaScript objects destroyed? 4 answers

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 well of hope. How do you execute stuff upon instance destruction?


回答1:


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



来源:https://stackoverflow.com/questions/22566307/javascripts-equivalent-of-destruct-in-object-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!