{
using disposer = new DisposableStack();
const resource = disposer.use(new Resource());
resource.doSomething();
// stack is disposed here immediately before the function exits
// which causes the resource to be disposed
}DisposableStack.prototype[Symbol.dispose]() / notebook
DisposableStack.prototype[Symbol.dispose]()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.