Skip to main content

Function: join()

Returns the result of concatenating the values of iterable to a string where values are separated by separator.

Like Array.prototype.join, but for iterables, but does not treat null, undefined, or [] specially.

Example

console.log(
pipe(
[`sloth`, `more sloth`, `even more sloth`],
join(`, `),
),
)
//=> sloth, more sloth, even more sloth

join(separator)

join(separator): (iterable) => string

Returns the result of concatenating the values of iterable to a string where values are separated by separator.

Like Array.prototype.join, but for iterables, but does not treat null, undefined, or [] specially.

Parameters

separator: string

Returns

Function

Parameters

iterable: Iterable<unknown, any, any>

Returns

string

Example

console.log(
pipe(
[`sloth`, `more sloth`, `even more sloth`],
join(`, `),
),
)
//=> sloth, more sloth, even more sloth

Defined in

collections.d.ts:397

join(separator, iterable)

join(separator, iterable): string

Returns the result of concatenating the values of iterable to a string where values are separated by separator.

Like Array.prototype.join, but for iterables, but does not treat null, undefined, or [] specially.

Parameters

separator: string

iterable: Iterable<unknown, any, any>

Returns

string

Example

console.log(
pipe(
[`sloth`, `more sloth`, `even more sloth`],
join(`, `),
),
)
//=> sloth, more sloth, even more sloth

Defined in

collections.d.ts:398