API Reference

Combines multiple strings into one string with specified separators, including a specific last separator.

join(arr: string[], separator: string, lastSeparator?: string): string

// Example:

join(["apples", "oranges"], " and ") //=> "apples and oranges"

join(["apples", "oranges"], ", ", " and ") //=> "apples and oranges"

join(["apples", "oranges", "bananas"], ", ", " and ") //=> "apples, oranges and bananas"