Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
77
rated 0 times [  79] [ 2]  / answers: 1 / hits: 76108  / 9 Years ago, thu, march 5, 2015, 12:00:00

Is there destructor in TypeScript? If not, how can I delete an object?
I tried destructor() and ~ClassName() but it didn't work.


More From » typescript

 Answers
2

JavaScript uses garbage collection to automatically delete objects when they are no longer referenced. There is no concept of destructors or finalizers.



You can't observe when an object is deleted by the garbage collector, nor is it predictable.


[#67554] Wednesday, March 4, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
emiliano

Total Points: 381
Total Questions: 109
Total Answers: 93

Location: Jersey
Member since Fri, Oct 1, 2021
3 Years ago
emiliano questions
;