join() function
주어진 iterable의 모든 요소를 구분자로 구분한 문자열로 반환합니다.
Signature:
typescript
declare function join<A extends readonly []>(sep: string, iterable: A): "";Example
ts
const joined = join('~', ['a', 'b', 'c']); // 'a~b~c'
// with pipe
pipe(
[1, 2, 3, 4],
map(a => a + 10),
filter(a => a % 2 === 0)
join('-'),
); // '12-14'
await pipe(
Promise.resolve([1, 2, 3, 4]),
join('-'),
); // '1-2-3-4'
// with toAsync
await pipe(
[Promise.resolve(1), Promise.resolve(2), Promise.resolve(3), Promise.resolve(4)],
toAsync,
join('-'),
); // '1-2-3-4'