Standard built-ins

Symbol.asyncDispose

Try the free JavaScript compiler

Key identifying an asynchronous cleanup method. Awaiting a manually invoked method demonstrates its contract, not await using syntax support.

Formal Syntax & Structure

javascript syntaxjavascript
Symbol.asyncDispose

Return Value

symbol

The predefined protocol key.

Working Example

Example Snippetjavascript
const r={async [Symbol.asyncDispose](){return "released";}};(async()=>console.log(await r[Symbol.asyncDispose]()))();
JavaScript Reference