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
Section titled “Parameters”| src |
|
| options | optional
|
Options
Section titled “Options”| ender | optionalChildrenWhen 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 | optionalChildrenThe string to place between each element. |
| skipFalsy | optionalbooleanWhen true, falsy values with the exception of 0 are skipped. |
Returns
Section titled “Returns”Children The joined array
See also
Section titled “See also”- mapJoin for mapping before joining.