join
The join() method concatenates the elements of an array of strings, inserting a separator between each of them. It respects the structure of tuples to statically compute the resulting string.
Interactive example
Syntax
Classic signature
typescript
function join<
GenericInput extends readonly string[],
GenericSeparator extends string
>(
input: GenericInput,
separator: GenericSeparator
): GenericInput extends AnyTuple ? ComputeResult<GenericInput, GenericSeparator> : stringCurried signature
typescript
function join<
GenericInput extends readonly string[],
GenericSeparator extends string
>(
separator: GenericSeparator
): (
input: GenericInput
) => GenericInput extends AnyTuple ? ComputeResult<GenericInput, GenericSeparator> : stringParameters
input: The array (or tuple) of strings to concatenate.separator: The string inserted between each element.
Return value
A string containing all elements separated by separator. When the input is a tuple, the result is known statically (ComputeResult).
