简体   繁体   English

销毁javascript中的对象

[英]destroying an object in javascript

This I know is quite a basic one, but, please tell me how can I destroy an object in javascript, that is created dynamically. 我知道这是一个很基本的知识,但是,请告诉我如何销毁动态创建的javascript对象。

Actually I have created an instance of nicEdit javascript text editor, and after taking user's input in it and saving the entered text, I want to destroy it. 实际上,我已经创建了nicEdit javascript文本编辑器的实例,在接受用户输入并保存输入的文本之后,我想销毁它。

Here's a snippet of code im using to create an instance: 这是用于创建实例的一小段代码:

    myNicEditor = new nicEditor();

Here nicEdit variable is global. nicEdit变量是全局的。

And here's how im destroying it right now: 现在,我立即将其销毁:

    myNicEditor = undefined;

inside a function. 在函数内部。 But, its not deleting. 但是,它没有删除。 I know this b'coz when i create another instance using same variable name, i'm able to see my last entered text, that it has saved internally. 当我使用相同的变量名创建另一个实例时,我知道这很奇怪,我能够看到我最后输入的文本,该文本已在内部保存。

Plz help.. 请帮助

只要看一下文档 ,它就会清楚地说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM