Removes the trailing slash from the end of the segment (if it exists)
const segment = removeTrailingSlash('example/');console.log(segment); // 'example' Copy
const segment = removeTrailingSlash('example/');console.log(segment); // 'example'
Removes the trailing slash from the end of the segment (if it exists)
Usage