If a DOM Element is removed, are its listeners also removed from memory in javascript?

JavascriptFront End TechnologyObject Oriented Programming

In modern browsers, if a DOM Element is removed, its listeners are also removed from memory in javascript.

Note that this will happen ONLY if the element is reference-free. Or in other words, it doesn't have any reference and can be garbage collected. Only then its event listeners will be removed from memory.

raja
Published on 02-Dec-2019 05:34:50
Advertisements