# TS1013: A rest parameter or binding pattern may not have a trailing comma.

> A rest parameter (`...args`) or rest element in a destructuring pattern is followed by a comma. Remove the comma after it.

## What it means

A rest parameter or rest element collects everything that's left, so nothing may follow it,
not even a trailing comma. This applies to function parameters (`...args,`) and to array and
object destructuring patterns (`[first, ...rest,]`).

## Example

```ts
function log(...messages: string[],) {}
export {};
```

## How to fix

- Delete the comma after the rest parameter or rest element.
- If you meant to add another parameter, it has to come before the rest parameter.

Source: https://ts-r.dev/errors/TS1013/
