MutationObserver
MutationObserver is a web API that provides a way to react to changes in the DOM. It allows you to register a callback that receives a list of MutationRecord objects whenever the observed DOM tree changes, enabling efficient response to dynamic content without polling.
It was introduced to replace the older Mutation Events system, which ran synchronously and could cause performance
Usage involves creating a MutationObserver with a callback function, then calling observe on a target node
MutationRecord objects describe each change and include fields: type (attributes, childList, characterData), target, addedNodes, removedNodes, previousSibling,
Common usages include monitoring DOM changes in web components, implementing responsive behavior for dynamic interfaces, or