Skip to main content

Function: join()

Returns the string concatenation of the values of iterable, separated by separator.

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

Example

import { join, map, pipe } from 'lfi'

console.log(
pipe(
[`sloth`, `lazy`, `sleep`],
map(word => word.toUpperCase()),
join(`, `),
),
)
//=> SLOTH, LAZY, SLEEP
Playground

Since

v0.0.1

Call Signature

join(separator): (iterable) => string

Parameters

separator

string

Returns

Function

Parameters

iterable

Iterable<unknown, any, any>

Returns

string

Defined in

collections.d.ts:450

Call Signature

join(separator, iterable): string

Parameters

separator

string

iterable

Iterable<unknown, any, any>

Returns

string

Defined in

collections.d.ts:451