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

ShadowRoot.append — adding nodes and text to a shadow tree

ShadowRoot.append adds nodes and text at the end of a shadow tree. It is inherited from DocumentFragment rather than a separate implementation. Learn how nodes move, fragments become empty, and appendChild() differs.

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

Storage: counting entries and reading key names

Storage exposes string key–value pairs through localStorage and sessionStorage. Learn the difference between Storage.length, which counts entries, and Storage.key(index), which returns a key name rather than its value.

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

Storage.clear() — removing all entries

Storage.clear() synchronously removes every key–value pair from the selected Web Storage area. It takes no arguments and returns undefined. Be careful: it also deletes entries unrelated to your code.

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

Storage.getItem — reading a Web Storage value

Storage.getItem(key) synchronously reads text from localStorage or sessionStorage. It returns null when the key does not exist; an empty string is an existing value, not a missing entry.

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

Storage.removeItem — removing one entry

The removeItem(key) method removes a specific key–value pair from localStorage or sessionStorage. It returns undefined; a missing key does not cause an error.

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

Storage.setItem — storing and replacing a value

Storage.setItem stores text under a key in localStorage or sessionStorage, replacing the previous value. Writes can fail, so account for exceptions and storage access restrictions.

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

structuredClone(): deep copying and data transfer

structuredClone() copies supported data structures, including nested objects and cycles. The transfer option moves resources instead of copying them; not every value type can be cloned.

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

TextDecoder — decoding bytes into text

TextDecoder converts bytes into text. Learn chunked decoding, error handling with fatal, and the meaning of ignoreBOM.

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

TextDecoderStream — streaming byte decoding

TextDecoderStream converts a byte stream into text, preserving decoder state between chunks.

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

TextEncoder — encoding text as UTF-8

TextEncoder converts text into UTF-8 bytes. Learn how encode() differs from encodeInto() and what the read and written counters mean.

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

TextEncoder.encode() — converting text to UTF-8 bytes

TextEncoder.encode() encodes a JavaScript string as UTF-8 and returns a Uint8Array containing the resulting bytes. Call it on a TextEncoder instance; the byte count does not necessarily match the string length.

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

TextEncoderStream — streaming UTF-8 encoding

TextEncoderStream transforms text chunks into UTF-8 bytes while preserving surrogate pairs split across chunks.

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

TransformStream — transforming a stream

TransformStream connects a writable side to a readable side. transform processes chunks, while flush can append final output before closure.

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

unhandledrejection — unhandled promise rejection

The unhandledrejection event reports a Promise rejection that remains unhandled when the browser reports it. It exposes the promise and rejection reason and is useful for diagnostics, not as a replacement for local error handling.

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

URL — parsing and modifying addresses

URL separates an address into components, resolves relative references, and lets you modify query 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

URL.hash — the URL fragment

URL.hash reads and sets a URL fragment. Learn its encoding behavior and the distinction between empty and absent fragments.

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

URL.pathname — reading and changing the path

URL.pathname lets you read or replace a URL's path without changing its query or fragment.

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 — query parameters

URLSearchParams reads and modifies query parameters, preserving repeated names and handling form-style encoding.

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

URL.searchParams — query parameters

URL.searchParams exposes query parameters as a URLSearchParams object linked to the URL.

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.append(): adding query parameters

append(name, value) adds a pair at the end of the query parameters, preserving earlier values with the same 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.delete(): removing query parameters

URLSearchParams.delete() removes every pair with a given name, or only pairs matching both the supplied name and value.

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.forEach — traversing query parameters

URLSearchParams.forEach calls a function for each parameter pair, preserving order and repeated names. The callback arguments are the value, key, and parameter object.

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.get — read a query parameter

URLSearchParams.get(name) returns the first parameter value as a string, or null when the parameter is absent.

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.getAll(): all values of a parameter

getAll(name) returns an array of every query parameter value with the specified name, preserving order and duplicates.

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