Intl.PluralRules — selecting a plural category
Intl.PluralRules selects a grammatical number category using locale-specific rules. Its select method returns a category name, not an inflected word or a complete message.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Intl.PluralRules selects a grammatical number category using locale-specific rules. Its select method returns a category name, not an inflected word or a complete message.
Intl.RelativeTimeFormat creates localized relative-time descriptions. Its format(value, unit) method takes a number and a unit, not a date; calculating the time difference remains the application's responsibility.
Intl.Segmenter finds grapheme, word, or sentence boundaries using locale-sensitive rules. Its segment() method returns iterable segment descriptions, and isWordLike lets you select segments classified as word-like.
KeyboardEvent.code identifies a key's physical position independently of keyboard layout and modifiers. Learn how code differs from key and where text input and virtual keyboards require a different approach.
Distinguish a key's value from its physical position, and inspect repetition, Shift state, and text composition. These KeyboardEvent fields help handle shortcuts without confusing keyboard layout with text input.
KeyboardEvent.key is a read-only string property describing a key’s meaning. It accounts for keyboard layout and modifiers; unlike code, it does not describe the key’s physical position.
KeyframeEffect describes an effect's target, keyframes, and timing parameters. A separate Animation object controls playback.
localStorage exposes a browser store of string key–value pairs associated with an origin. Data can outlast a session, but access and persistence depend on browser policy.
The window.location object exposes the current page's complete URL and its components. Learn how origin, pathname, search, hash, and href differ, and why writing to Location can trigger navigation.
Location.hash reads and changes the current page's URL fragment. A nonempty value read from it includes the leading # character.
Location.href exposes the document URL as a string. Assigning a value initiates navigation rather than merely changing an ordinary variable.
MediaQueryList lets you inspect a media query's result and react when it changes. The matches property supplies the current boolean value, while the change event reports transitions between matching and not matching.
MediaQueryList.matches is a read-only boolean property indicating whether a media query matches the document's current state.
MessageChannel creates two connected ports for asynchronous, bidirectional messaging. Learn how to receive events, start delivery, clone data, and close ports when communication is finished.
The messageerror event on a Worker signals that an incoming message could not be deserialized. Distinguish it from a sending failure in postMessage() and from the error event associated with a worker error.
MessageEvent.data is a read-only property that exposes a message's payload. Its type depends on the messaging mechanism, so do not assume the value is always text.
MessagePort is one of the two endpoints of a bidirectional channel. It enables asynchronous delivery of data and transferable objects between connected pieces of code.
MouseEvent.clientY is a read-only property that gives a mouse event’s vertical coordinate relative to the viewport. It does not describe a position relative to the target element or the physical screen.
MouseEvent fields expose the button associated with an event, viewport-relative pointer coordinates, and the state of Ctrl, Meta, Shift, and Alt. Distinguish button from buttons and viewport coordinates from document coordinates.
MutationObserver records selected DOM changes and delivers records asynchronously to a callback. Learn how observe() configures observation, takeRecords() drains the queue, and disconnect() stops observation.
MutationRecord describes one observed DOM change. Learn how to identify its type and affected node, inspect added and removed nodes, and retrieve an attribute name and previous value.
Navigator.clipboard exposes a Clipboard object for asynchronous reading and writing of the system clipboard. It requires a secure context, and access is subject to browser restrictions.
Node is the shared interface for DOM nodes, including elements and text. It provides tree relationships, node-type inspection, and operations for changing a node's children.
Node.appendChild adds a node as a parent's last child. It returns the supplied node and moves an existing node rather than copying it.