Posts

Showing posts from December, 2022

getting the last segment of url

const parts = props.location.pathname.split('/'); const lastSegment = parts.pop() || parts.pop(); alert(lastSegment)