Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

Knowledge base — JavaScript

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 1003

JavaScript

IntersectionObserver options: root, rootMargin, and threshold

Choose the reference area with `root`, adjust its bounds for the calculation with `rootMargin`, and use `threshold` to specify which fractions of the target’s area trigger notifications.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Intl.Collator: sensitivity and locale rules

Compare and sort strings using the selected locale’s rules. The `sensitivity` option controls which differences matter to the comparison.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Intl.DateTimeFormat.formatToParts(): date and time parts

Get the parts of a localized date or time so you can style one component without guessing the field order or splitting the formatted text on punctuation.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Intl.DateTimeFormat: inspect the effective options

Use `resolvedOptions()` to see which date and time formatting settings an instance actually uses instead of inferring them from the constructor arguments.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Time zones and hour cycles in Intl.DateTimeFormat

`timeZone` selects the local time to display for an instant, while `hourCycle` controls how the hour is numbered, including whether midnight appears as `00` or `24`.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Intl.NumberFormat: currency and percent options

Format amounts and ratios for a locale. Learn when a currency code is mandatory, why 0.125 represents 12.5%, and how to control the digits after the decimal separator.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Intl.PluralRules.prototype.select(): choose a plural category

`select(value)` returns a grammatical category for one value using the instance’s locale and options. Use the result to choose a translated message, not to format a number.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Intl.Segmenter: segment() and isWordLike

Split text into locale-sensitive segments and use `isWordLike` to distinguish segments treated as words from the other segments in the result.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Iterator protocol: next(), return(), value, and done

Use `done`, not `value`, to detect the end of an iterator. Learn how to read a completion value and when `for...of` calls the optional `return()` method.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

JSON graph references and path escaping

Preserve shared objects and cycles in JSON text with explicit `$ref` markers and paths that distinguish characters in keys from path separators.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

KeyboardEvent: key value and text composition state

Use `key` to recognize a key's meaning and `isComposing` to avoid triggering a shortcut while an input method is still composing text.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

KeyboardEvent: key values and auto-repeat

Use `key` to identify the key value and `repeat` to distinguish an initial press from automatic repeats while a key is held down.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

KeyboardEvent: key value and Shift state

`key` tells you the key value, while `shiftKey` tells you whether Shift was active when the event occurred. Use both to distinguish Enter from Shift+Enter.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Location: fragment, origin, path, query, and full URL

Read the five URL properties of a browser document and distinguish navigation-triggering assignments from the read-only origin.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Map iterators: next(), value, and done

Step through a Map iterator with `next()` and use `done` to tell a stored `undefined` apart from the end of iteration.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

MessageEvent: source, origin, and data

Distinguish the sender reference, the sender’s origin at send time, and the payload, and learn what to validate before handling a window message.

Advanced · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

Method definition shorthand

Use `name(p) { … }` to define a method without a colon or the `function` keyword. The call supplies `this`, while the definition determines where `super` starts looking up properties.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies
JavaScript

MouseEvent: button code and viewport coordinates

Use `button` to identify the button pressed or released in a mouse event, and `clientX` and `clientY` to read where the event occurred in the viewport.

Intermediate · ECMAScript 2024 and the current web platform; runtime support varies