π Enforce using the separator argument with Array#join().
πΌ This rule is enabled in the following configs: β
recommended, βοΈ unopinionated.
π§ This rule is automatically fixable by the --fix CLI option.
It's better to make it clear what the separator is when calling Array#join(), instead of relying on the default comma (',') separator.
// β
const string = array.join();
// β
const string = array.join(',');// β
const string = array.join('|');// β
const string = Array.prototype.join.call(arrayLike);
// β
const string = Array.prototype.join.call(arrayLike, '');// β
const string = [].join.call(arrayLike);
// β
const string = [].join.call(arrayLike, '\n');