Intersection Observer
A web API that asynchronously notifies when an element enters (or leaves) the viewport or another container. It replaces expensive scroll-event listeners with an efficient, built-in mechanism for "is this visible?".
The old problem: to know whether an element is visible (for lazy loading, infinite scroll, scroll animations) you listened to the scroll event and measured positions manually — which triggers constantly, forces expensive layout calculations, and stutters. Intersection Observer does it right: you register elements to watch, and the browser calls your callback (asynchronously, off the critical rendering path) only when their visibility actually crosses a threshold you've specified. Use case: lazy loading (load images/content as they approach the screen), infinite scroll (load more when the bottom is visible), animate-on-scroll, visibility tracking (ads, analytics). Win: dramatically better performance than scroll listeners. One of three "observer" APIs (with Resize and Mutation). A fundamental modern web technique. Related to resize observer and lazy loading.