Skip to content

join

Place a joiner between each element of an array or iterator. Defaults to joining with a newline.

import { join } from "@alloy-js/core";
function join<T extends Children>(src: T[] | Iterator<T>, options?: JoinOptions): Children;
srcT[] | Iterator<T>
optionsoptional JoinOptions
enderoptional ChildrenWhen true, the joiner is placed at the end of the array. When a string, that string is placed at the end of the array. The ender is only emitted when the array has at least one element.
joineroptional ChildrenThe string to place between each element.
skipFalsyoptional booleanWhen true, falsy values with the exception of 0 are skipped.

Children The joined array

  • mapJoin for mapping before joining.