Pergunta de entrevista da empresa Salesforce

How does garbage collection work in Javascript?