Published
- 1 min read
get last path segment of url in javascript
The solution for this is noted below
get last path segment of url in javascript
Solution
const last_segment = window.location.pathname.split('/').pop()
Try other methods by searching on the site. That is if this doesn’t work