What is the Javascript method CollectGarbage()? When and why should it be used?

前端 未结 3 1090
花落未央
花落未央 2021-01-08 01:22

I notice in the VS2010 javascript intellisence there is a method called CollectGarbage().

Is this an IE only method?
When should it be used?
What are the ad

3条回答
  •  盖世英雄少女心
    2021-01-08 02:02

    It's part of the Microsoft JScript library. The documentation for it is pretty poor. I'm not sure how it works, but I would assume that it looks through the members of an object for things that it can delete.

    And, as bdukes mentioned, this should not be called in your code. Leave it to the inner workings of the JScript library.

提交回复
热议问题