JavaScriptThe repeat(count) method returns consecutive copies of a string without changing the original. A Symbol or BigInt count causes TypeError during numeric conversion. If conversion and truncation yield a negative integer or either infinity, the method throws RangeError.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptreplace() returns text with matches replaced, without changing the original. Learn the difference between string and regular-expression searches, and between replacement templates and replacement functions.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptreplaceAll replaces every non-overlapping match of a string or global regular expression without changing the original string. The replacement can be text or a function.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe search() method finds the first regular-expression match and returns its index or -1. A string argument is interpreted as a pattern, not as a literal substring.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptString.prototype.slice returns part of a string from start inclusive to end exclusive without changing the original. Negative indices count from the end, and omitting end extracts the rest of the string.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptString.prototype.split divides text at a separator and returns an array of parts. Learn how limits and empty elements work, and how an empty separator differs from an omitted separator.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe startsWith method checks whether a string has a given prefix at its beginning or exactly at a specified position. It returns a boolean, is case-sensitive, and does not modify the string.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptsubstring() returns the portion of a string between start and end, excluding end. It leaves the original unchanged, clamps indices to the string length, and swaps the boundaries when they are reversed.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe toLowerCase() method returns a string converted to lowercase using Unicode rules, without changing the original. It takes no parameters and does not adapt its result to the user's language.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptString.prototype.toString() returns the primitive string value of a string or String object. It is not a general converter: an incompatible this value causes a TypeError.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe toUpperCase() method returns text with letters converted to uppercase using Unicode default casing rules. It leaves the original unchanged, takes no arguments, and can change the length of the result.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScripttrim() returns text without leading and trailing whitespace or line terminators. It leaves the original string and internal spacing unchanged and does not accept an argument specifying which characters to remove.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScripttrimEnd() returns a string without trailing whitespace and line terminators. If the string contains only those characters, it returns an empty string. The original is unchanged.
Basic · ECMAScript 2019. The main ECMAScript specification defines String.prototype.trimRight as a legacy alias whose initial value is the same function object as String.prototype.trimEnd.JavaScripttrimStart() returns text with leading whitespace and line terminators defined by ECMAScript removed. It leaves the original string unchanged and preserves characters inside the text and at its end.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptString.raw is a static method used as a template literal tag. It preserves the spelling of sequences such as \n in literal text segments, while still evaluating ${...} expressions and inserting their values.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSymbol.asyncIterator is a built-in symbol identifying the method that supplies an object's async iterator. It lets for await...of retrieve successive values while awaiting the results of next().
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSymbol.for(key) looks up a symbol in the global registry by a string key. It returns the existing symbol or creates and registers a new one, allowing independent pieces of code to obtain the same symbol property key.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSymbol.iterator is the well-known symbol identifying an iterator-producing method. It lets a custom object work with for...of and array spread. An iterable supplies an iterator, while the iterator supplies successive results through next().
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSymbol.toPrimitive is a well-known symbol identifying an object's primitive-conversion method. The method receives the hint "string", "number", or "default" and takes precedence over the ordinary use of valueOf() and toString().
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSymbol.toStringTag is a well-known symbol used as the property key that supplies the tag in Object.prototype.toString() output. It changes an object's description, not its actual type.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptSyntaxError indicates a parsing failure in code or text that requires a particular syntax, such as JSON. Learn the difference between an error that prevents a script from running and an exception thrown during execution.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptThe byteLength property reports the number of bytes covered by a typed array view, not its element count or the size of its entire buffer. It is read from an instance and has no setter.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptLearn the difference between element counts and byte counts in TypedArray. See how buffer and byteOffset describe a view and why subarray() shares data while slice() creates an independent copy.
Intermediate · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API supportJavaScriptTypedArray.length denotes the number of elements in a typed array, not its byte count. Read it from an instance, such as values.length; it is not a way to resize the view.
Basic · ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support