How to destroy a JavaScript object?

后端 未结 5 1544
青春惊慌失措
青春惊慌失措 2020-12-07 17:16

Recently, I came across one of my application which consumes too much memory and increasing by 10 MB/sec.

So, I like to know the best way to destroy JavaScript objec

5条回答
  •  暖寄归人
    2020-12-07 18:09

    You can't delete objects, they are removed when there are no more references to them. You can delete references with delete.

    However, if you have created circular references in your objects you may have to de-couple some things.

提交回复
热议问题