DisposableStack() constructor
The DisposableStack()
constructor creates DisposableStack
objects.
Syntax
Parameters
None.
Return value
A new DisposableStack
object.
Examples
Creating an DisposableStack
js
const disposer = new DisposableStack();
disposer.defer(() => console.log("Disposed!"));
disposer.dispose();
// Logs: Disposed!
Specifications
No specification found
No specification data found for javascript.builtins.DisposableStack.DisposableStack
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.