For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/fp/join.md.

join (Functional Programming) es-toolkit

Creates a function that joins array values into a string. Use it with pipe.

const result = pipe(array, join(separator));
Info

This helper is specific to es-toolkit/fp. Use it when you want this operation as part of a pipe pipeline.

Usage

join converts the piped array to a string by joining its values with separator. When separator is omitted, it uses a comma.

import { join, pipe } from 'es-toolkit/fp';

pipe(['a', 'b', 'c'], join('-')); // => 'a-b-c'

pipe(['a', 'b', 'c'], join()); // => 'a,b,c'

Parameters

separatorstring, optionalrequired

The string inserted between values. Defaults to ,.

Returns

A function that maps a readonly T[] to a joined string.

(array: readonly T[]) => string
Source: es-toolkit

Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.