IntersectionObserver
What is IntersectionObserver?
IntersectionObserver is an API that allows JavaScript to observe changes in the intersection of a target element with an ancestor element or the browser’s viewport. It is useful when you want to know if an element is visible on the screen or not.
How does it