Skip to content

unicorn/require-array-join-separator Style

🛠️ An auto-fix is available for this rule for some violations.

What it does

Enforce using the separator argument with Array#join()

Why is this bad?

It's better to make it clear what the separator is when calling Array#join(), instead of relying on the default comma (',') separator.

Example

Examples of incorrect code for this rule:

javascript
foo.join();

Examples of correct code for this rule:

javascript
foo.join(",");

References

Released under the MIT License.