[removed] Create and destroy class instance through class method

后端 未结 3 1203
抹茶落季
抹茶落季 2021-02-03 18:16

I\'m trying to figure out how to delete an object through a class method. I would like to be able to create a class that has a destroy method that releases the object from memor

3条回答
  •  故里飘歌
    2021-02-03 18:53

    No. JavaScript is automatically garbage collected; the object's memory will be reclaimed only if the GC decides to run and the object is eligible for collection.

    Seeing as that will happen automatically as required, what would be the purpose of reclaiming the memory explicitly?

提交回复
热议问题