Regex pour obtenir le premier mot après une barre oblique dans l'URL
window.location.pathname.replace(/^\/([^\/]*).*$/, '$1');
Aditya
window.location.pathname.replace(/^\/([^\/]*).*$/, '$1');