JSFiddle - React, Tailwind, and code Playground
HTML
<select id="filtrar"></select>
JavaScript
var url = "url.com/explorer/videos/medicine/top/yesterday/";
//url.replace(/\/$/, "") will remove the last occurance of '/' if exists
options = url.replace(/\/$/, "").split('/').slice(2);
var elem = $("#filtrar");
$(options).each(function (ind, data) {
console.log(data)
if (data != null || data != undefined || data.length > 0)
{
elem.append('<option value="' + data + '">' + data + '</option>');
}
});