3

When a CoffeeScript class is instantiated a constructor called. This works. However, now I would like to delete a instantiaed object. Is there any destructor to call? (I would like to clear a timer)

2
  • No, you have to do that manually. Do you want a method that is invoked by garbage collector runs or what?
    – Bergi
    May 3, 2013 at 12:36
  • I could have a method that I call to "destroy" the object. I was wondering if there was a more formal method. I was also wondering if there were a way to delete an instantiated class
    – Alexis
    May 3, 2013 at 12:40

1 Answer 1

7

This isn't possible with JavaScript so it is not possible with CoffeeScript. If you have some clean up to do, you need to determine by yourself when the right moment is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.