Web APIs

WritableStreamDefaultWriter.closed

Try the free JavaScript compiler

Promise that fulfills when the associated stream closes, or rejects if it errors or the writer releases its lock before closure.

Formal Syntax & Structure

javascript syntaxjavascript
writer.closed

Return Value

Promise<void>

Closure promise.

Working Example

Example Snippetjavascript
(async()=>{const w=new WritableStream().getWriter(); const done=w.closed; await w.close(); await done; console.log("closed"); w.releaseLock();})()
JavaScript Reference