options object
A plain JavaScript object passed to a function to set named options, such as { passive: true } or { childList: true }.
In more detail
Named options make calls readable and easy to extend. Many web APIs, including addEventListener, observe and fetch, accept one as their last argument.
Related terms
- MutationObserver options — The settings passed to observe() that choose what a MutationObserver watches: child nodes, attributes, text, and whether to include the whole subtree.
- passive event listener — An event listener registered with { passive: true }, which promises never to call preventDefault, so the browser can scroll immediately without waiting for it.
Taught in
- MutationObserver: Reactive DOM Watching Without Polling — Frontend Architecture & Web Platform
- Passive Listeners, Scroll Performance And Touch Interactions — Frontend Architecture & Web Platform
- Cancellation With AbortController And Async Signal Propagation — Frontend Architecture & Web Platform