Currently with my code:
window.location.pathname.split('/')[3]
I can get "comparative" from:
http://localhost/study/78/comparative
But it's possible that some subdirectories will be added to the URI.
How can I get the last substring (the most to the right) on the URI separated with /
?