---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# 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

```js
close()
```

### Parameters

None.

### Return value

None (`undefined`).

### Exceptions

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