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

URLSearchParams.has() — checking parameter presence

URLSearchParams.has() checks whether a parameter name or a name–value pair exists. It returns true or false without changing the parameters.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

URLSearchParams.set(): setting a query parameter

URLSearchParams.set() assigns one parameter value, removing duplicates or appending a missing name.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

URLSearchParams.sort(): sorting parameters by name

URLSearchParams.sort() orders parameters by name, mutating the object. Entries with identical names retain their original order.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

URLSearchParams.prototype.toString — serializing query parameters

Calling `params.toString()` returns the query parameters as text without a leading `?`. It uses form encoding while preserving order and repeated names.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

ValidityState — a form control's validation state

ValidityState exposes read-only error flags for a form control. It distinguishes a missing required value, an invalid format, and text that is too short, with an important exception for values assigned by scripts.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

ValidityState.valid — aggregate control validity

ValidityState.valid is a read-only boolean property: it is true when none of the control's validation error flags are set.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Window — the browser document context

Window exposes browser interfaces to a page: pixel information, relationships between windows, and resize and navigation events. Learn how Window differs from WindowProxy and why cross-origin access remains restricted.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Window.getComputedStyle — reading resolved styles

Window.getComputedStyle reads an element's resolved CSS values after stylesheets have been applied. It returns a live, read-only object rather than a copy of inline declarations.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

window.getSelection() — document selection

window.getSelection() exposes the current document's Selection object for reading and changing its selection.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

hashchange — Window URL fragment changes

The hashchange event on window reports a URL fragment change during same-document navigation. It provides the previous and new URLs, but calling pushState() or replaceState() does not itself fire it.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

window.matchMedia — testing media queries

window.matchMedia tests a CSS media query from JavaScript. It returns a MediaQueryList with the current matches result and lets you observe changes in whether the query matches.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

window.onerror — global script error handling

window.onerror handles error events reported to the window. For an ErrorEvent it receives five arguments, and returning true cancels default error reporting without resuming the interrupted code.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

window.postMessage — messaging between windows

window.postMessage asynchronously sends data to a target window, including across origins. Prefer an exact `targetOrigin`; omitting it restricts delivery to the same origin. Receivers should validate the sender's origin, the sending window, and the payload structure.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Worker — computation off the main thread

Worker runs a dedicated script independently of the page interface. It returns results asynchronously through messages, without direct access to the page DOM.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Worker events: messages and errors

Worker.onmessage receives worker replies, Worker.onerror reports worker failures, and Worker.onmessageerror handles unsuccessful deserialization of an incoming message. These three handlers belong to the Worker object in the code that created the worker.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

WorkerGlobalScope.self — the worker global object

The read-only WorkerGlobalScope.self property returns the current worker's global object. Use self for explicit access to its interfaces and event handling; it is neither the window object nor access to the page's DOM.

Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Worker.postMessage — sending data to a worker

Worker.postMessage sends data to a dedicated worker through an asynchronous message channel. Data is structured-cloned, while an optional transfer list lets you transfer resources such as ArrayBuffer instead of copying them.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

Worker.terminate(): forcibly stopping a worker

worker.terminate() stops a dedicated worker from code holding its Worker object. The method takes no arguments and returns undefined; it does not guarantee completion of the current task or execution of cleanup code.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support
JavaScript

WritableStream — writable stream

WritableStream serializes writes of data chunks to a sink. Promises let producers control their pace.

Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support