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

Object.prototype, property descriptors, and accessors

Separate where a property is found in the prototype chain from how it behaves: it can store a value or use a getter or setter.

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

Object shorthand and computed property access

Use property shorthand when a variable and its property share a name. Use brackets to compute a key when defining, reading, or writing a property.

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

Object shorthand syntax

Create properties from existing variables and define methods without `function`. Distinguish property shorthand from computed keys and destructuring.

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

Pointer capture: commit or abort a drag

Track one drag by `pointerId` and finish it only once: commit on release or abort on cancellation or early loss of capture.

Intermediate · Current web platform; runtime support varies
JavaScript

Captured pointer drags: commit or roll back

Keep the drag preview separate from the committed value, and settle the drag only once even when capture loss follows release.

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

PointerEvent: pointer ID and viewport coordinates

Use `pointerId` to tell simultaneously active pointers apart, and `clientX` and `clientY` to locate an event in the viewport in CSS pixels.

Advanced · Current web platform; runtime support varies
JavaScript

PointerEvent: pointer identity and primary status

`pointerId` links events from the same active pointer; `isPrimary` tells you whether that pointer is primary for its input type.

Intermediate · Current web platform; runtime support varies
JavaScript

Promise.allSettled() result records

`Promise.allSettled()` fulfills with an array of outcomes in input order once all input promises have settled. Read each record’s `status` to decide whether to use `value` or `reason`.

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

Promise executor resolve and reject functions

The Promise constructor supplies two functions to its executor. The first call to either locks in the promise’s outcome, but it does not always settle the promise immediately.

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

Property accessors in JavaScript

Dot notation names a fixed key; bracket notation computes one. Either form can read stored data or trigger a getter or setter, depending on the property.

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

Property access syntax

Use dot notation for a fixed name and brackets for a computed key. Learn how private access differs and exactly when optional chaining skips a read.

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

PropertyDescriptor.value — the value of a data property

The `value` field holds a data property's stored value. Omitting it from an input descriptor is different from explicitly specifying `value: undefined`.

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

Proxy `get` and `set` traps and the `receiver` parameter

The `get` and `set` traps intercept property reads and writes. Passing `receiver` to `Reflect` preserves the receiver of the original operation.

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

Editing the DOM with Range

Cut, insert, and delete DOM content. Learn how to position a range, collapse it to a single point, and tell what `cloneRange()` copies.

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

RegExp character classes, quantifiers and anchors

Choose what a pattern can match, how many times it can repeat, and where it can match. Combine these tools to validate an entire string or find a matching line.

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

RegExp flags g/i/m/u and Unicode property escapes

Learn how global, case-insensitive, multiline, and Unicode-aware matching work together, and how to match letters or other characters by Unicode property.

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

RegExp match results: `index` and `groups`

Read where the full match starts and what each named group captured. Use the `d` flag when you also need start and end offsets.

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

Regular expression flags: dotAll (`s`), `u`, `i`, and `g`

The `s`, `u`, `i`, and `g` flags control dot matching across line breaks, Unicode-aware matching, case-insensitive matching, and global search, respectively.

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

Positive and negative lookahead and lookbehind

Require or rule out context immediately before or after a position in a string without including that context in the full match.

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