there is an example on the MDN document.
function createObserver() {
let observer;
let options = {
root: null,
rootMargin: "0px",
threshold: buildThresholdList()
};
observer = new IntersectionObserver(handleIntersect, options);
observer.observe(boxElement);
}
I am wondering when is the observer object would be free by the GC.
Because there is no variable access to observer after function is end.But this example still functional.
Can memory usage be seem in chrome dev-tool ?
Thank for any help !!