Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

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

Entries: 5788

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
JavaScript

MouseEvent: mouse buttons and modifier keys

Read which mouse button an event concerns and whether Ctrl, Meta, Shift, or Alt was active. Use `buttons`, not `button`, to test which buttons are held.

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

Mouse coordinates: clientX, clientY, mousemove, and mouseleave

Read the cursor position relative to the viewport, update the interface as the mouse moves, and clear state when the cursor leaves an element and its descendants.

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

MutationObserver: observe(), disconnect(), and takeRecords()

Watch selected DOM changes, collect pending records without waiting for the callback, and stop observing with or without keeping the records still in the queue.

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

MutationRecord: how to read a DOM change

Identify what changed and which node was affected, inspect added or removed children, and tell when a record contains the previous value.

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

NaN: the special Number value and how to detect it

`NaN` is a special `Number` value. Use `Number.isNaN()` to detect it without converting the argument, unlike the global `isNaN()` function.

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

Inspecting and modifying DOM nodes with `Node`

Test whether a node belongs to a subtree, read its parent or first child, insert a node at a specific position, and merge adjacent text nodes.

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

DOM nodes: type, value, and child nodes

Tell text nodes from elements, read the value of an individual node, and traverse direct children without overlooking changes to the live list.

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

Computed method keys in object literals

Use `[expr](...) { ... }` in an object literal to define a method under a key determined by an expression. The key is a string or a symbol.

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

Object computed property access

Use `obj[expr]` to read or assign a property selected by an expression instead of using a fixed name after a dot.

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

Computed property key in an object literal

Use `[expression]: value` to choose a property key when an object is created. The resulting key is a string or a symbol.

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

Object destructuring and shorthand

Object destructuring reads properties from an existing value. Property shorthand goes the other way: it uses variables to create same-named properties on a new object.

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

Object destructuring declaration

An object destructuring declaration creates variable bindings from source properties. The pattern lets you rename bindings, set defaults, and collect the remaining properties.

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

Object destructuring

Object destructuring reads properties by key rather than by position. Use it to declare variables, assign to existing targets, provide defaults, or collect remaining properties.

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

Defining a getter in an object literal

Use `get` in an object literal to run a function when a property is read, so the value can reflect the object's current state without an explicit method call.

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

Object method definitions

Write `name(a) {}` to define a method in an object literal. Learn how the call sets `this`, where `super` starts its lookup, and why the method cannot be used with `new`.

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