JSFiddle - React, Tailwind, and code Playground

HTML

<select id="myselect">

</select>

JavaScript

arrs=[ {label:"test1", array:["L1", "L12", "D03"]} , {label: "test2", array: ["L6", "L7", "C08"]} ];


$('#myselect').on('change',function() {
 sel_arr= arrs[$(this).val()].array;
console.log(sel_arr);
});


arrs.forEach( function(elt, idx){ 
                 $opt= $('<option/>').html(elt.label).val(idx);
                 $('#myselect').append($opt);
                 }
                 );