---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# close()

The **`close()`** method of the `ReadableByteStreamController` interface closes the associated stream.

This might be called by the underlying source when its data source has been exhausted/completed.

> **Note:** Readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed.
> However if there is an outstanding and partially written `byobRequest` when `close()` is called, the stream will be errored.

## Syntax

```js
close()
```

### Parameters

None.

### Return value

`undefined`.

### Exceptions

- `TypeError`
  - : Thrown if the source object is not a `ReadableByteStreamController`, it is already closed, or the stream is not readable for some other reason.
