Web APIs
WritableStream.locked
Indicates whether a writer currently holds the exclusive stream lock.
Formal Syntax & Structure
javascript syntaxjavascript
stream.lockedReturn 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);