>You called addEventListener but forgot to call removeEventListener.
Shouldn't this be handled by the browser gc? If the element isn't in the DOM and there aren't any js references left anymore
Shouldn't this be handled by the browser gc? If the element isn't in the DOM and there aren't any js references left anymore
However, if you're adding event listeners to the document, the window, or some permanent element (header, footer, etc.), then those won't be GC'ed since the DOM node is never GC'ed.