Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING BASH RUST

Basic JavaScript

JS Tutorial JS Syntax JS Variables JS Operators JS If Conditions JS Loops JS Strings JS Numbers JS Functions JS Objects JS Dates JS Arrays JS Typed Arrays JS Sets JS Maps JS Math JS RegExp JS Data Types JS Errors JS Events JS Programming JS References JS Versions

JS Advanced

JS Functions JS Objects JS Classes JS Iterations JS Asynchronous JS Modules JS Meta & Proxy JS HTML DOM JS Windows JS Web API JS AJAX JS JSON JS jQuery JS Graphics JS Examples JS Reference


ECMAScript 2026


New Features in JavaScript 2026

FeatureDescription
Error.isError() Checks whether a value is an Error object
Array.fromAsync() Copies items from async iterables into a new array
The using keyword Declares block-scoped variables synchronously disposed
await using Automatic cleanup of resources
Uint8Array fromBase64() Creates a Uint8Array object from a base64-encoded string
Uint8Array toBase64() Returns a base64-encoded string from the data in an int8Array
Uint8Array fromHex() Creates a Uint8Array object from a hexadecimal string
Uint8Array toHex() Returns a hex-encoded string from the data in an int8Array

Warning

The 2026 edition is not published yet. It normally ships in June.

As of November 2025, this is a list of the features in the draft, that is likely to be in the ES2026.


Error.isError()

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

Example

Error.isError(new TypeError()); // true
Error.isError({ name: "Error" }); // false
Try it Yourself »

Error.isError() is a safe alternative to instanceof Error which fails across realms.

Realm-safe error check:
An Error from an iframe verifies with Error.isError() and fails with instanceof.

Browser Support

Error.isError() is already supported in many browsers:

Chrome
134
Edge
134
Firefox
138
Safari
Opera
119
Mar 2025 Mar 2025 Apr 2025 May 2025

Array.fromAsync()

Example

async function* asyncGenerator() {
  yield Promise.resolve(1);
  yield Promise.resolve(2);
  yield Promise.resolve(3);
}

async function processAsyncData() {
  const arr = await Array.fromAsync(asyncGenerator());
}

processAsyncData();
Try it Yourself »

Browser Support

Array.fromAsync() is already supported in many browsers:

Chrome
121
Edge
121
Firefox
115
Safari
16.4
Opera
Jan 2024 Jan 2024 Jul 2023 May 2023

Uint8Array to/fromBase64()

Examples

let string = 'W3Schools 123';

const arr = Uint8Array.fromBase64(string);
Try it Yourself »
const arr = new Uint8Array([91,116,156,134,138,37,179,93,183]);

let text = arr.toBase64();
Try it Yourself »

Browser Support

to/fromBase64() is already supported in many browsers:

Chrome
140
Edge
140
Firefox
133
Safari
18.2
Opera
Sep 2025 Sep 2025 Nov 2024 Des 2024

Uint8Array to/fromHex()

Examples

let text = '5b749c868a25b35db7';

const arr = Uint8Array.fromHex(text);
Try it Yourself »
const arr = new Uint8Array([91,116,156,134,138,37,179,93,183]);

let text = arr.toHex();
Try it Yourself »

Browser Support

to/fromHex() is already supported in many browsers:

Chrome
140
Edge
140
Firefox
133
Safari
18.2
Opera
Sep 2025 Sep 2025 Nov 2024 Des 2024

Explicit Resource Management

The using Keyword

The using keyword is an addition to JavaScript 2026. It provides a mechanism for managing resources that require explicit disposal.

It declares a block-scoped variable, similar to const, but with the difference that it guarantees synchronous disposal of the used resource when the variable goes out of scope.

Example

class MyResource {
  constructor(name) {
    this.name = name;
    myDisplay(`Resource ${this.name} acquired.`);
  }
  [Symbol.dispose]() {
    myDisplay(`Resource ${this.name} disposed.`);
  }
}

function manageResource() {
using resource = new MyResource("Database Connection");

// Use the resource here
myDisplay(`Using resource: ${resource.name}`);
}
Try it Yourself »

The using keyword simplifies resource management by automatically handling the cleanup process, reducing the risk of resource leaks and improving code readability compared to manual try...finally blocks for disposal.

  • Resource Management
    using is designed for objects that implement the Symbol.dispose method, which defines the cleanup logic for the resource.

  • Synchronous Disposal
    When a variable declared with using exits its scope (at the end of a block or function), its Symbol.dispose method is automatically called.

  • Asynchronous Disposal
    For resources requiring asynchronous cleanup, the await using declaration can be employed. This ensures that the disposal process is awaited before the variable fully goes out of scope.

  • Block-Scoped
    Like const, variables declared with using are local to the block in which they are declared, and must be initialized at the time of declaration.

  • Immutable
    Like to const, variables declared with using cannot be reassigned after initialization.

Browser Support

using is already supported in many browsers:

Chrome
134
Edge
134
Firefox
141
Safari
Opera
119
Mar 2025 Mar 2025 Jul 2025 May 2025

Explicit Resource Management

await using

Inspired by other languages, JavaScript 2026 introduces using blocks for automatic cleanup of resources like file handles, database connections, or network streams.

This is especially beneficial for asynchronous operations:

Example

async function processFile() {
  using fileHandle = await openFile('data.txt');

// Work with fileHandle here

} // fileHandle is automatically closed here
Try it Yourself »

Browser Support

await using is already supported in many browsers:

Chrome
134
Edge
134
Firefox
141
Safari
Opera
119
Mar 2025 Mar 2025 Jul 2025 May 2025


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.