Skip to main content
Version: 3.27.2

ReadableStreamDefaultController.close()

The close() method of the ReadableStreamDefaultController interface closes the associated stream.

Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed. If you want to completely get rid of the stream and discard any enqueued chunks, you'd use ReadableStream.cancel() or ReadableStreamDefaultReader.cancel().

Syntax

close()

Parameters

None.

Return value

None (undefined).

Exceptions

  • TypeError
    • : Thrown if the source object is not a ReadableStreamDefaultController.