开发者

How to clear a object from memory using JavaScript [duplicate]

开发者 https://www.devze.com 2023-01-20 17:14 出处:网络
This question already has answers here: Closed 10 years ago. Possible Duplicate: Deleting Objects in JavaScript
This question already has answers here: Closed 10 years ago.

Possible Duplicate:

Deleting Objects in JavaScript

This is the demo code:

开发者_如何学Python
function a(){
    this.a='aaa'
}
var aa=new a

How to clear the aa object from the memory?


I may be wrong but I think setting the variable to null should do the trick.


set aa = null, alert(aa)!

0

精彩评论

暂无评论...
验证码 换一张
取 消