Web APIs

WritableStream.locked

Try the free JavaScript compiler

Indicates whether a writer currently holds the exclusive stream lock.

Formal Syntax & Structure

javascript syntaxjavascript
stream.locked

Return Value

boolean

True when a writer is attached.

Working Example

Example Snippetjavascript
const s=new WritableStream(); const w=s.getWriter(); console.log(s.locked); w.releaseLock(); console.log(s.locked);
JavaScript Reference