JavaScript

Baseline Ready

A practical reference for deciding whether a JavaScript feature is ready to use now.

  • Widely available
    80
    features
  • Newly available
    21
    features
  • Limited support
    20
    features

Widely available

Widely available
Widely Arrays

Array (initial support)

Arrays are ordered lists of JavaScript values.

Widely Arrays

Array at()

The at() method of arrays and typed arrays returns the item at an index, including negative indices for getting items relative to the end of an array. Also known as the relative indexing method.

Widely Arrays

Array by copy

The toReversed(), toSorted(), toSpliced(), and with() methods of arrays and typed arrays return changed copies of arrays. They stand in contrast to methods such as sort() or reverse() that change arrays in place.

Widely Arrays

Array copyWithin()

The copyWithin() method of arrays and typed arrays shifts or copies items of an array to another index of the array without changing its length.

Widely Arrays

Array fill()

The fill() method of arrays and typed arrays sets all or some items of an array to a given a value.

Widely Arrays

Array find() and findIndex()

The find() and findIndex() methods of arrays and typed arrays search an array for the first item that satisfies a test function.

Widely Arrays

Array findLast() and findLastIndex()

The findLast() and findLastIndex() methods of arrays and typed arrays search an array in reverse order for the first item that satisfies a test function.

Widely Arrays

Array flat() and flatMap()

The flat() and flatMap() methods for arrays creates a new array such that each nested array item is concatenated into it.

Widely Arrays

Array includes()

The includes() method of arrays and typed arrays returns whether a given value appears in the array.

Widely Arrays

Array iteration methods

Array iteration methods

Widely Arrays

Array iterators

Arrays are iterable with the for … of statement and enumerable with the methods entries(), keys(), and values().

Widely Arrays

Array splice()

The array splice() method changes an array in-place. You can use it to delete items, overwrite items, or insert items, starting from an index.

Widely Arrays

Array.from()

The Array.from() and typed array .from() static methods copy items from an iterable or array-like object to make a new array.

Widely Arrays

Array.isArray()

The Array.isArray() static method checks whether a value is an array.

Widely Arrays

Array.of()

The Array.of() and typed array .of() static methods create new arrays from the values of any number of arguments.

Widely Arrays

Stable array sort

Stable array sort() function

Widely Async

Async functions

The async and await keywords allow you to use the asynchronous, promise-based behavior of a function without using promise chains.

Widely Async

Promise (initial support)

A promise represents an asynchronous operation which eventually succeeds or fails.

Widely Async

Promise finally()

The promise finally() method executes a function when the promise settles (resolves or rejects).

Widely Async

Promise.allSettled()

The Promise.allSettled() static method waits for an array of promises to settle (resolve or reject).

Widely Async

Promise.any()

The Promise.any() static method returns a promise that fulfills as soon as the first of an iterable of promises fulfills, with that promise's value. Otherwise, it rejects with an AggregateError when all of the promises have rejected.

Widely Data

JSON

The JSON API provides static methods for parsing values from and converting values to JavaScript Object Notation (JSON), a serialization format for objects, arrays, numbers, strings, Boolean values, and null.

Widely Internationalization

Intl.DisplayNames

The Intl.DisplayNames API provides localized names of language, region, script, and currency codes.

Widely Internationalization

Intl.ListFormat

The Intl.ListFormat API creates a locale-aware formatter that turns iterable objects into localized strings.

Widely Internationalization

Intl.PluralRules

The Intl.PluralRules API creates a locale-aware object that tells you which of the language's pluralization rules apply based on a given number.

Widely Internationalization

Intl.RelativeTimeFormat

The Intl.RelativeTimeFormat API creates a locale-aware formatter that turns an object representing a relative time (such as '1 day ago') into a localized string.

Widely Internationalization (Intl)

Intl

The Intl API provides language sensitive string comparison, number formatting, date and time formatting, and more.

Widely Internationalization (Intl)

Intl.Locale

The Intl.Locale API parses Unicode locale identifiers, with language, region, and script codes, such as zh-Hans-CN or en-GB.

Widely Iterators

Async iterators and the for await..of loop

Asynchronous iterator objects, such as those returned by promises or generator functions, are iterable with the for await .. of loop.

Widely Iterators

Iterators and the for...of loop

The for...of loop operates on a sequence of values sourced from an iterable object, such as arrays, array-like objects, DOM collections, iterators, generators, and user-defined iterables. All built-in iterators inherit from the Iterator class.

Widely Iterators

Typed array iterators

Typed arrays are iterable with the for … of statement and enumerable with the methods entries(), keys(), and values().

Widely Language core

Async generators

Async generator functions (async function*) create iterators that return multiple promises, one after another, on-demand.

Widely Language core

BigInt

The BigInt JavaScript type represents integers of any size, including integers too large for the primitive Number type.

Widely Language core

BigInt64Array

The BigInt64Array and BigUint64Array typed arrays represent 64-bit integers, signed and unsigned respectively.

Widely Language core

Classes

Classes are an object-oriented syntax for JavaScript prototypes.

Widely Language core

Destructuring

The destructuring assignment syntax is a JavaScript expression that unpacks values from arrays, or properties from objects, into distinct variables.

Widely Language core

Error cause

The cause property of errors records the specific original cause of the error, particularly for errors that have been re-thrown.

Widely Language core

Exponentiation operator

The exponentiation (**) operator returns the result of raising the first operand to the power of the second operand.

Widely Language core

Functions

Functions are series of statements that can be called and return a value. The function keyword (as in function () { }) and arrow (=>) expression create functions. The JavaScript functions protocol includes default and rest parameters and binding to this.

Widely Language core

Generators

Generator functions (function*) create iterators that return multiple values, one after another, on-demand.

Widely Language core

globalThis

The globalThis property accesses the global this value (and hence the global object itself) across environments.

Widely Language core

Hashbang comments

The #! comment at the absolute start of a script or module is treated as a normal comment and is ignored by the JavaScript engine.

Widely Language core

JavaScript (initial core language support)

JavaScript is a programming language that runs in browsers, usually through the <script> element. JavaScript has changed over many years. This feature represents the oldest language features, such as built-in objects, statements, and operators. Also known as ECMAScript.

Widely Language core

Let and const

The let and const declarations define block-scoped variables.

Widely Language core

Logical assignments

The logical AND assignment (&&=) and the logical OR assignment (||=) operators short-circuit the respective binary logical operators.

Widely Language core

Nullish coalescing

The nullish coalescing (??) and nullish coalescing assignment (??=) operators return (or assign) its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand.

Widely Language core

Numeric separators

To improve readability for numeric literals, underscores (_) can be used as separators. For example, 1_050.95 is equivalent to 1050.95.

Widely Language core

Optional catch binding

Omit the the binding parameter of a catch clause when you don't need information about the exception in a try ... catch statement.

Widely Language core

Proxy and Reflect

The Proxy and Reflect JavaScript built-ins intercept and define custom behavior for fundamental language operations (such as property lookup, assignment, enumeration, or function invocation).

Widely Language core

SharedArrayBuffer and Atomics

The SharedArrayBuffer object represents bytes shared between multiple workers and the main thread. The Atomics object safely accesses SharedArrayBuffer data to make sure predictable values are read and written and that operations are not interrupted.

Widely Language core

Template literals

Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.

Widely Language core

Unicode point escapes

Unicode point escapes (\\u{}) represent Unicode characters within strings.

Widely Language core

Weak references

The WeakRef and FinalizationRegistry objects hold references to garbage-collectable objects without creating strong references that prevent their garbage collection.

Widely Map and Set

Map (initial support)

Map objects hold key-value pairs and remember the original insertion order of the keys.

Widely Map and Set

Set (initial support)

Set objects store unique values of any type.

Widely Modules

JavaScript modules

JavaScript modules allow code to be organized into reusable units. Modules use import to load other modules and export to declare what is available to import from other modules. In HTML, modules are loaded with <script type="module">.

Widely Modules

JavaScript modules in workers

The Worker() constructor accepts { type: "module" } to load scripts that use import and export. Also known as ECMAScript modules or ESM in workers.

Widely Objects

Object

Objects in JavaScript are collections of key-value pairs.

Widely Objects

Object.hasOwn()

The Object.hasOwn() static method checks whether an object has a given property. It's a more robust alternative to the Object.prototype.hasOwnProperty() method.

Widely Primitive types

Date

The Date object represents a single moment in time.

Widely Primitive types

Math and numbers

The number type (and Number object) represents floating-point numbers, such as 42 or -4.201, while the Math API contains mathematical functions and constants. JavaScript can also represent boundless negative and positive values as Infinity or not-a-number as NaN (as in 0 * Infinity).

Widely Primitive types

String (initial support)

The string type (and String object) represents a sequence of characters.

Widely Primitive types

Symbol

A Symbol value is a unique, non-enumerable primitive value used for encapsulation or information hiding. For example, a symbol can be a key of an object that can never collide with any other key.

Widely Strings

String at()

The at() method of strings returns the character (one UTF-16 code unit) at an index, including negative indices for getting the character relative to the end of the string. Also known as the relative indexing method.

Widely Strings

String codePointAt() and fromCodePoint()

The codePointAt() method returns the numeric value of the UTF-16 code point at an index of the string. The fromCodePoint() method returns a string created from one or more code points.

Widely Strings

String includes()

The includes() method of strings returns whether a search string appears within the string.

Widely Strings

String matchAll()

The matchAll() method of strings matches a string against a regular expression and returns an iterator of all results, including capturing groups.

Widely Strings

String normalize()

The normalize() method of strings returns a Unicode normal form of a string as a new string. More than one code point sequence can represent the same characters. You can use the normalize() method to find canonically or compatibly equivalent strings.

Widely Strings

String padStart() and padEnd()

The padStart() and padEnd() methods of strings return a string lengthened to a minimum number of characters by adding characters to the start or end of the string.

Widely Strings

String raw()

The String.raw() static method interpolates template literal substitutions, but ignores escape sequences. It is the tag function for template literals.

Widely Strings

String repeat()

The repeat() method of strings returns the original string repeated a number of times.

Widely Strings

String replaceAll()

The replaceAll() method of strings returns a new string where all matches of a pattern (a string or regular expression) have been substituted with a replacement string.

Widely Strings

String startsWith() and endsWith()

The startsWith() and endsWith() methods of strings returns whether a search string appears at the beginning or end of the provided string.

Widely Strings

String trimStart() and trimEnd()

The trimStart() and trimEnd() methods of strings return a new string with whitespace removed from the beginning or end of the string.

Widely Syntax

Spread syntax

The spread (...) syntax allows an iterable, such as an array or string, to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected.

Widely Text processing

Regular expressions

The RegExp object represents a regular expression, a notation for matching text patterns.

Widely Typed arrays

Typed array iteration methods

Typed array iteration methods

Widely Typed arrays

Typed arrays (initial support)

Typed arrays are ordered lists of JavaScript values, where all values are of the same numerical type, such as 8-bit integers or 32-bit floating point numbers.

Widely WeakMap and WeakSet

WeakMap

A WeakMap object holds key-value pairs that do not create strong references to its keys, such that value data can be associated with a key without preventing garbage collection of the key.

Widely WeakMap and WeakSet

WeakSet

A WeakSet object stores unique values of any type without creating strong references to the values, such that membership in the set does not prevent garbage collection of the value.

Available with conditions

Newly available
Newly Arrays

Array grouping

The Object.groupBy() and Map.groupBy() static methods group values of arrays and iterables based on a function that returns a key for each value.

Newly Arrays

Array.fromAsync()

The Array.fromAsync() static method copies items from an async iterable object to make a new array.

Newly Async

Promise.withResolvers()

The Promise.withResolvers() static method is an alternative to the Promise() constructor that returns both the promise and resolution functions. You can use this to access resolve and reject outside the scope of the executor function.

Newly Async processing

Promise.try()

The Promise.try() static method returns a promise that takes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result in a Promise.

Newly Internationalization

Intl.Segmenter

The Intl.Segmenter API creates a locale-aware text splitter that can separate a string into meaningful graphemes, words, or sentences.

Newly Internationalization (Intl)

Intl.DurationFormat

The Intl.DurationFormat API creates a locale-aware formatter that turns an object representing a duration (such as days, hours, and minutes) into a string.

Newly Iterators

Iterator methods

The Iterator object is an abstract base for objects that implement the iterator protocol. It provides methods common to built-in iterators, such as filter(), find(), map(), and reduce(). You can also use the static method Iterator.from() to convert an existing iterable into an Iterator.

Newly Iterators

Iterator.concat()

The Iterator.concat() JavaScript method returns an iterator that yields values from a sequence of iterators, exhausting each iterator before moving on to the next.

Newly JSON

JSON import attributes

Module import … with { type: "json" } statements load JSON data. Also known as JSON module scripts.

Newly JSON

JSON source text access

To serialize and parse JSON in a lossless way, JSON.stringify() handles rawJSON values and JSON.parse()'s reviver callback takes a source context parameter.

Newly Language core

Atomics.pause()

The Atomics.pause() static method gives a hint to the CPU that the code calling the method is in a short-duration wait for shared memory, known as spinning or a spinlock.

Newly Language core

Atomics.waitAsync()

The Atomics.waitAsync() static method waits for a value in a shared memory location, providing a promise when the expected value is not yet in memory. The waitAsync() method is a non-blocking alternative to Atomics.wait().

Newly Language core

Resizable buffers

The resize() method of an ArrayBuffer and the grow() method of a SharedArrayBuffer, constructed with the maxByteLength option, changes the size of the buffer in place.

Newly Language core

Transferable ArrayBuffer

The transfer() and transferToFixedLength() methods of ArrayBuffer move a buffer from one context to another (for example, to a worker).

Newly Map and Set

Map getOrInsert()

The getOrInsert() and getOrInsertComputed() methods of Map objects get a value, setting and getting a default value if needed.

Newly Map and Set

Set methods

The difference(), intersection(), isDisjointFrom(), isSubsetOf(), isSupersetOf(), symmetricDifference(), and union() methods of the JavaScript Set object performs operations between two sets.

Newly Modules

JavaScript modules in service workers

The navigator.serviceWorker.register() method accepts { type: "module" } to load scripts that use import and export. Also known as ECMAScript modules or ESM in service workers.

Newly Strings

String isWellFormed() and toWellFormed()

The isWellFormed() method of strings returns a boolean indicating if the string contains any Unicode lone surrogates. The toWellFormed() method returns a new string where all lone surrogates are replaced by the Unicode replacement character.

Newly Text processing

RegExp.escape()

The RegExp.escape() static method takes a string and replaces any characters that are potentially special characters of a regular expression with equivalent escape sequences. For example, RegExp.escape("[abc]") returns "\\[abc\\]".

Newly Typed arrays

Float16Array

Float16Array is a typed array of 16-bit floating point numbers.

Newly Typed arrays

Uint8Array base64 and hex conversion

The Uint8Array object methods fromBase64(), toBase64(), and setFromBase64() convert to and from base64 strings. The fromHex(), toHex(), and setFromHex() methods convert to and from hex strings.

Limited support

Limited support
Limited Error handling

Serializable errors

The DOMException, Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, and URIError objects are serializable. You can call structuredClone() on an error object or pass it to a worker using postMessage().

Limited Internationalization (Intl)

Intl.Locale info

The getter methods of the Intl.Locale API provide supplemental information about a Unicode locale, such as the locale's calendar (for example, the first day in a week or the weekend start day), writing direction, 12- or 24-hour cycles, and numbering system.

Limited Language core

__proto__

The __proto__ property of objects partially exposes the prototype of an object.

Limited Language core

Accessor methods

The __defineGetter__() and __defineSetter__() methods of objects bind a function to a property, which is called on setting or reading the property.

Limited Language core

arguments.callee

The callee property of the arguments variable in a non-strict function body's local scope is the function that arguments belongs to.

Limited Language core

Error.isError()

The Error.isError() static method checks whether a value is an Error object.

Limited Language core

escape() and unescape()

The escape() and unescape() built-in Javascript methods encode and unencode strings using percent encoding, where certain characters are replaced by hexadecimal escape sequences.

Limited Language core

Function caller and arguments

The caller and arguments properties of a non-strict mode Function object are the function that called it and the arguments it was called with. Not to be confused with the arguments variable in a function body's local scope.

Limited Language core

getYear() and setYear()

The getYear() and setYear() methods of Date objects get and set the year as an offset to 1900.

Limited Language core

HTML wrapper methods

JavaScript built-in methods such as, String.bold() and String.italics(), wrap strings in (often historic) HTML.

Limited Language core

Math.sumPrecise()

The Math.sumPrecise() static method returns the sum of an iterable of numbers. It avoids the precision loss of intermediate partial sums, as found using reduce() or a loop to add together an array of values.

Limited Language core

Temporal

The Temporal API allows you to work with dates, times, time zones, and durations. It is more powerful than the Date API.

Limited Language core

toGMTString()

The toGMTString() method of Date objects is an alias to the toUTCString() method.

Limited Language core

Top-level await

The await keyword, when used at the top level of a module (outside of an async function), delays parent module execution until after a promise fulfills.

Limited Language core

with

The with JavaScript statement adds a given object to the chain of scopes used to evaluate names.

Limited Modules

CSS import attributes

Module import … with { type: "css" } statements load CSS modules as constructable stylesheets. Also known as CSS module scripts.

Limited Modules

Import assertions

Module import … assert { type: "json" } and import … assert { type: "css" } JavaScript statements load JSON and CSS data.

Limited Regular expressions

RegExp compile()

The compile() method of RegExp objects recompiles an existing regular expression object using a new pattern and flags.

Limited Regular expressions

RegExp static properties

The RegExp object has several static properties to access the input and results of the most-recent regular expression match.

Limited Resource management

Explicit resource management

The using and await using declarations and the dispose and asyncDispose symbols manage the lifecycle of resources such as file handles and streams. The DisposableStack and AsyncDisposableStack objects can group, dispose, and coordinate dependencies between multiple disposable resources.