Web APIs
ReadableStream.locked
Report whether a reader or piping operation has locked the stream. A second independent reader cannot acquire the same lock. Example console output: true false.
Formal Syntax & Structure
javascript syntaxjavascript
stream.lockedReturn Value
boolean
Whether the stream is locked.
Working Example
Example Snippetjavascript
const s=new ReadableStream(); const reader=s.getReader(); console.log(s.locked); reader.releaseLock(); console.log(s.locked);