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

Web Components: custom elements and lifecycle

Web Components are web-platform mechanisms for building custom interface elements. Learn how to register a class extending HTMLElement, respond to connection and disconnection, and observe attributes. These are browser APIs, not features supplied by ECMAScript itself.

Intermediate · Web-platform APIs, not tied to an ECMAScript edition. The example's exact console output was verified in isolated Chromium 157.0.8103.51 only; this does not establish broader browser compatibility. Node 24 in the repository does not establish browser API support.
JavaScript

AnalyserNode: FFT spectrum and waveform bytes

Set the FFT window size and spectrum smoothing, then size separate byte arrays for frequency bins and time-domain samples.

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

Array and computed property indexing

The same square brackets select array elements and access object properties by keys computed at runtime.

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

Array destructuring

Take values from an iterable in order, skip positions, provide defaults, and collect the remaining values in a new array.

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

Array destructuring binding

An array binding pattern initializes variables from values in iteration order. It can skip values, supply defaults, and collect the remaining values into a new array.

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

Array destructuring parameter

Unpack values from one iterable argument directly in a function signature, and distinguish an element default from a default for the entire parameter.

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

Array destructuring parameters

Use an array pattern to unpack one iterable argument in a function’s parameter list. Defaults for the argument and for individual values are separate.

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

Array indexing syntax in JavaScript

Use square brackets to read and write zero-based array elements. Whether a key is an array index affects `length`, and a missing element is not the same as a stored `undefined`.

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

Array length and indexing in JavaScript

An array’s `length` defines its index span, not how many elements are present. Writing a new index can extend the array, while shortening it can delete elements.

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

Array length and indexing in JavaScript

An array’s `length` sets its index boundary; it does not count elements. Learn how indexed writes change that boundary and how to tell a hole from `undefined`.

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

`length`: the writable property of an array

Read `arr.length` to get an array’s length, or assign to it to truncate the same array or extend it without creating elements.

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

Arrow function syntax

Arrow functions use `=>`. The parameter list determines whether parentheses are required, and the body form determines whether a value is returned implicitly. The surrounding scope supplies `this`.

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

Lexical `this` in arrow functions

An arrow function has no `this` binding of its own. It uses the binding from its enclosing lexical context, regardless of how the arrow is called.

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

AudioContext: analyse and play audio from a media element

Route an audio or video element through an analyser to the audio output, and manage graph processing separately from the element’s playback.

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

`Blob` constructor: creating immutable byte data

Use `new Blob()` to combine text and binary parts into an immutable sequence of bytes. Options set the MIME label and control how text line endings are handled.

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

Canvas 2D: clear a region and draw a filled circle

Separate clearing pixels from resetting the path. Build a circle with `arc()`, choose a paint with `fillStyle`, and render its interior with `fill()`.

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

Canvas 2D: clearing, drawing, and editing pixels

Distinguish Canvas 2D drawing operations from direct bitmap reads and writes, and know when each coordinate system applies.

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

Canvas 2D: fill style, stroke style, and line width

`fillStyle` controls what fills a shape, `strokeStyle` controls what paints its outline, and `lineWidth` sets the outline's thickness. Each is a separate Canvas 2D drawing-state property.

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

Canvas 2D: stroke, fill, font, and text baseline

Set stroke width and paint, fill paint, the font, and the vertical text anchor on a Canvas 2D rendering context.

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

Canvas 2D: saving and restoring drawing state

`save()` pushes the current drawing state onto a stack, and `restore()` pops and reinstates the most recently saved state. Neither method undoes changes to pixels.

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