Salesforce interview question

How does garbage collection work in Javascript?