# unicorn/require-array-join-separator

> Require the separator argument of `Array#join()`

Without an argument, `join()` puts a comma between the items. A reader might expect no separator at all, or a comma and a space. Writing the separator out removes the guesswork.

The rule only looks at the method name, so it reports `.join()` without arguments on any object. It also reports `Array.prototype.join.call(items)` and `[].join.call(items)`.

`--fix` adds `","`, which keeps the result the same.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"unicorn/require-array-join-separator" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad {"count": 2} */}
```js
const header = columns.join();
const names = Array.prototype.join.call(arguments);
```

Not reported:

{/* good */}
```js
const header = columns.join(",");
const names = Array.prototype.join.call(arguments, ", ");
const word = letters.join("");
```
