# Source: https://github.com/quick-lint/quick-lint-js/blob/master/docs/errors/E0151.md

# E0151: invalid function parameter

```config-for-examples
{
  "globals": {
    "classes": true,
    "delimiter": true,
    "join": true
  }
}
```

A function parameter can be a variable name, an array destructuring, or an
object destructuring. It is a syntax error for a function parameter to look like
a function call or any other expression:

```javascript
const join = (string, delimiter += ",") =>
  string.join(delimiter);

function cssClass(classes()) {
  return join(Object.keys(classes), " ");
}
```

To fix this error, write `=` to make a parameter have a default value:

```javascript
const join = (string, delimiter = ",") =>
  string.join(delimiter);
```

Alternatively, remove the parentheses indicating a function call:

```javascript
function cssClass(classes) {
  return join(Object.keys(classes), " ");
}
```

Introduced in quick-lint-js version 0.3.0.