 <p>JavaScript does garbage collection automatically for you.</p> <p>It might free it right away or it might wait when the moment is best. This is up to the JavaScript implementation.</p> <p>So no, it won't cause a memory leak.</p>