how to get last path from url in javascript

Solutions on MaxInterview for how to get last path from url in javascript by the best coders in the world

showing results for - "how to get last path from url in javascript"
Simon
02 Feb 2016
1const lastSegmentOfUrl = this.href.substring(this.href.lastIndexOf('/') + 1);