Populate Dropdown with Javascript

actually still with jquery. populateDrodpdown(id, container) {         let _this = this         let dropdown = $(‘#’ + container);         dropdown.empty();                fetch(baseUrl + ‘someGet/’ + id)         .then((response) => {             return response.json();         })         .then((data) => {             $.each(data, function (key, data) {                 dropdown.append($(‘<option></option>’).attr(‘value’, data.id).text(data.name));             })             dropdown.prop(‘selectedIndex’, 0);         });     }