Skip to content

Function: join()

ts
function join(...paths): string;

Combines an array of path segments into a single path string, with forward slashes (/) as separators.

Parameters

ParameterTypeDescription
...pathsstring[]An array of path segments to join.

Returns

string

A combined path string.

Since

1.0.0

Example

ts
join('foo', 'bar', 'baz') // => 'foo/bar/baz'
join('foo/', '/bar') // => 'foo/bar'

Released under the MIT License.