Travis build: 1553

This commit is contained in:
30secondsofcode
2019-11-06 17:28:06 +00:00
parent c9dadc5450
commit 99cd824e03
16 changed files with 1646 additions and 493 deletions

View File

@ -11,15 +11,14 @@ Omit the second argument, `separator`, to use a default separator of `','`.
Omit the third argument, `end`, to use the same value as `separator` by default.
```js
const join = (arr, separator = ',', end = separator) =>
arr.reduce(
(acc, val, i) =>
i === arr.length - 2
? acc + val + end
: i === arr.length - 1
? acc + val
: acc + val + separator,
? acc + val
: acc + val + separator,
''
);
```