@tempots/std
joinArrayWithConjunction() function
Joins an array of values into a string using a conjunction and separator.
Signature:
joinArrayWithConjunction: (arr: A[], conjunction?: string, separator?: string) => string
Parameters
Parameter |
Type |
Description |
---|---|---|
arr |
A[] |
The array of values to join. |
conjunction |
string |
(Optional) The conjunction to use between the second-to-last and last value. Default is ' and '. |
separator |
string |
(Optional) The separator to use between each value. Default is ', '. |
Returns: string
The joined string.