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

Stack, queue, and LRU cache algorithms

Compare a LIFO stack, a FIFO queue built from two stacks, and an LRU cache that evicts the least recently used entry when it exceeds capacity.

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

Strict mode directive in JavaScript

The `"use strict"` directive opts a classic script or a function into strict mode. ECMAScript modules and class definitions are already strict.

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

Tagged template literal syntax

A tag function receives a template literal’s text segments and substitution values separately. The tag’s return value becomes the value of the whole expression.

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

Template literals in JavaScript

Build multiline strings and insert expression results. Learn when JavaScript produces a string and when it passes text segments and values to a tag function.

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

Template literal syntax

Template literals let you write multiline text and interpolate expressions. A tagged template passes text segments and substitution values separately to a function.

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

`throttle` — limit how often a function runs

`throttle` limits how often a function runs even when calls keep arriving. Use it, for example, to reduce the work done during scrolling.

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

TransformStream: transform, flush, and controller.enqueue

Process input chunks with `transform()`, emit results with `controller.enqueue()`, and release buffered output with `flush()` on normal close.

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

Typed arrays: element count, view bytes, and buffer bytes

Distinguish the backing buffer object (`.buffer`), the view's element count (`.length`) and byte count (`.byteLength`), and the whole buffer's current byte count (`.buffer.byteLength`).

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

Typed array length and indexing

`length` counts elements in a typed array view, not bytes. Bracket indexing starts at zero, and writing past the end does not extend the view.

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

Typed arrays: `subarray()` view versus `slice()` copy

`subarray()` creates a view of the same buffer, while `slice()` copies the selected elements into a separate buffer by default. Both interpret range bounds the same way.

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

Unary negation syntax: prefix minus (`-`)

Unary minus `-x` converts one operand to a numeric value and then negates it. The result is a `Number` or a `BigInt`.

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

Unicode code points versus grapheme clusters

JavaScript measures string length in UTF-16 code units, iterates by code point, and uses `Intl.Segmenter` to find grapheme cluster boundaries.

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

URL.hash and URL.href: fragment versus full URL

Use `hash` to read or change the fragment and `href` to read or replace the whole URL. The `hash` getter alone cannot distinguish an empty fragment from an absent one.

Advanced · Current web platform; runtime support varies
JavaScript

`URL.origin`, `URL.pathname`, and `URL.search`

Distinguish a parsed URL’s origin, path, and query, and read individual query parameters without splitting the address by hand.

Advanced · Current web platform; runtime support varies
JavaScript

UTF-16 code units and surrogate pairs

JavaScript string length counts UTF-16 code units, not Unicode code points or user-perceived characters. The distinction matters when indexing, slicing, or iterating over text.

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

UTF-16 code units, surrogate pairs, and Unicode normalization

Distinguish code units, code points, and grapheme clusters. Check whether a string is well-formed UTF-16 and choose a normalization form for text comparison.

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