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

Set.prototype.keys() — a set value iterator

Set.prototype.keys() returns a new iterator over a set's values in insertion order. It returns neither indexes nor an array: in a Set, keys and values refer to the same elements.

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

Set.prototype.size — number of elements in a set

The size property reports the current number of distinct values in a Set. Read it as set.size, without parentheses. An empty set has size 0, and adding the same value again does not increase its size.

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

Set.prototype.symmetricDifference — symmetric difference of sets

If the input elements remain unchanged during the call, symmetricDifference() returns a new Set containing values present in exactly one of the two sets. The method itself does not modify the input sets.

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

Set.prototype.union — set union

Set.prototype.union(other) creates a new Set containing values from both sets without duplicates. It preserves the left set's order, then appends new values from other. The argument must support the set-like object protocol, not merely iteration.

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

Set.prototype.values() — a set's value iterator

The values() method returns a new iterator over a Set's values in insertion order. It does not create an array or copy the set; reading advances the iterator, and changes to the set can affect the remaining traversal.

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

SharedArrayBuffer — shared binary memory

SharedArrayBuffer holds bytes that different JavaScript agents can access. Views interpret those bytes, while Atomics helps coordinate concurrent operations.

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

String.fromCharCode — build text from UTF-16 code units

String.fromCharCode creates a string from supplied UTF-16 code units. It does not interpret arguments as complete Unicode code points: characters outside the Basic Multilingual Plane require a surrogate pair.

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

String.fromCodePoint — create text from code points

String.fromCodePoint creates a string from Unicode code points, including values above 0xFFFF. It automatically encodes them as UTF-16; invalid numeric values cause RangeError.

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

String.length — string length in UTF-16 units

A string's length property returns its number of UTF-16 code units, which is not always its number of user-perceived characters. Read it as text.length, without parentheses.

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

String.prototype.at — read a UTF-16 code unit by index

String.prototype.at(index) returns a string containing one UTF-16 code unit. Negative indices count from the end, and an out-of-range position returns undefined.

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

String.prototype.charAt — UTF-16 code unit at an index

The charAt() method returns a string containing one UTF-16 code unit at a zero-based index, or an empty string outside the valid range. It does not guarantee a complete Unicode character.

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

String.prototype.charCodeAt — UTF-16 code unit value

The charCodeAt method returns the numeric value of the UTF-16 code unit at an index, or NaN outside the string. It does not always return a complete Unicode code point.

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

String.prototype.codePointAt — reading a code point

The codePointAt(pos) method returns the numeric value of the code point starting at a specified UTF-16 index. It recognizes surrogate pairs, but the index still identifies a code unit, not the next character visible on screen.

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

String.prototype.concat — joining strings

String.prototype.concat appends any number of arguments to a string, converting them to text. It returns a primitive string value and leaves the original string unchanged.

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

String.prototype.endsWith — checking a string suffix

String.prototype.endsWith checks whether a string ends with specified text and returns true or false. It is case-sensitive, leaves the string unchanged, and lets you specify an earlier end boundary for the check.

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

String.prototype.includes — checking for a substring

String.prototype.includes checks whether text contains a given substring and returns true or false. It is case-sensitive, supports a starting position, and does not accept ordinary regular expressions.

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

String.prototype.indexOf — finding a substring

String.prototype.indexOf returns the index of the first substring match at or after the starting point obtained by converting and clamping position, or -1 if there is no match. It is case-sensitive and measures indices in UTF-16 code units.

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

String.prototype.lastIndexOf — last substring occurrence

lastIndexOf() returns the index of the last substring occurrence or -1. The optional position limits where a match starts, not where it ends.

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

String.prototype.localeCompare — locale-sensitive text comparison

String.prototype.localeCompare compares two strings using linguistic ordering rules. The sign of its result determines their order; locales and options customize comparison in environments supporting ECMA-402.

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

String.prototype.match — regular expression matches

The match() method finds regular expression matches in a string. The g flag changes the result shape: without it you get at most one match with capturing groups; with it you get an array of full matches. No match produces null.

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

String.prototype.matchAll — a match iterator with capture groups

String.prototype.matchAll returns an iterator over regular-expression matches, including capture groups and positions. For an ordinary RegExp it requires the g flag and leaves the original pattern's lastIndex unchanged.

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

String.prototype.normalize — Unicode normalization

normalize() returns text in a selected Unicode normalization form. It helps compare equivalent character representations and supports NFC, NFD, NFKC, and NFKD, defaulting to NFC.

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

String.prototype.padEnd — padding the end of a string

String.prototype.padEnd pads the end of a string to a target length by repeating a supplied string or default spaces. It leaves the original unchanged and never shortens a string that is already long enough.

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

String.prototype.padStart — padding text on the left

String.prototype.padStart pads the beginning of a string to a specified length by repeating and, when necessary, truncating the padding. It leaves the original unchanged and never shortens a string that is already long enough. Length is measured in UTF-16 code units.

Basic · Introduced in ECMAScript 2017 (ES2017) as a standard-library method. Node.js 24 support does not establish browser support.