Como obter o segmento URI em JS
const pathArray = window.location.pathname.split("/");
const segment_1 = pathArray[1];
Sajana Ashen
const pathArray = window.location.pathname.split("/");
const segment_1 = pathArray[1];