Joins the segments into a single url correctly handling leading and trailing slashes in each segment.
const url = join('https://example.com', '', 'api/', '/examples/');console.log(url); // https://example.com/api/examples Copy
const url = join('https://example.com', '', 'api/', '/examples/');console.log(url); // https://example.com/api/examples
Joins the segments into a single url correctly handling leading and trailing slashes in each segment.
Usage