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;
Parameters
src |
|
options | optional
|
Options
ender | optionalChildren When 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. |
joiner | optionalChildren The string to place between each element. |
skipFalsy | optionalboolean When true, falsy values with the exception of 0 are skipped. |
Returns
Children
The joined array
See also
- mapJoin for mapping before joining.