Standard built-ins

Symbol.dispose

Try the free JavaScript compiler

Key identifying a synchronous cleanup method used by explicit resource management. The presence of the symbol does not prove using syntax support.

Formal Syntax & Structure

javascript syntaxjavascript
Symbol.dispose

Return Value

symbol

The predefined protocol key.

Working Example

Example Snippetjavascript
const r={[Symbol.dispose](){console.log("released");}};r[Symbol.dispose]();
JavaScript Reference